Description
In the RequestHandler.reconfigure method there is a potential race condition when the configuration passed in is empty of nodes (all nodes must be removed) and two such configurations are quickly subjected to reconfigure (which would mean they are with different revision numbers).
The race condition is as follows:
- the first configuration causes the nodes set to empty
- the second configuration, due to the race condition, doesn't see the set as empty (so takes the second path) but it is when hitting the next line of code, that in turn creates an empty Observable
In this case, since said Observable is chained in with a last(), an error is thrown (NoSuchElementException).