don't allow proxying requests to self #497
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Even with the change in #463, it still appears to be possible to end up in a state where a supposed non-leader instance ends up getting itself as the leader path. When this happens, in
RedirectFilter
,jobScheduler.isLeader == false
butjobScheduler.getLeader
returns the path of the current instance. This results in chronos redirecting all requests to itself, and, ultimately an unresponsive REST api. It never appears to be able to recover when in this state. If the other chronos instances think that the stuck node is the leader, they will also end up being unresponsive resulting in an unusable chronos cluster.Unfortunately, it is a bit difficult to reproduce the problem. One way I have found where I can duplicate it with some consistency is to have 3 servers, each running zookeeper, chronos, and mesos. Then, reboot each server serially. Often (but not always), one of the Chronos instances will have proxied all requests to itself and will be unresponsive.
I am not very familiar with the chronos code (or scala for that matter) so there may be a better way to handle this. And, it does not address the root cause of why and how
JobScheduler
ends up thinking it is not a leader but yet still returns the current instance's path fromgetLeader
- I have not been able to figure that out. But, this commit does seem to prevent chronos from proxying requests to itself and ending up in the unresponsive state.