Fix operation queue to only affect reexecuteOperation #662
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.
Fix #661
Previously any call that dispatches an operation could
lead to a queued dispatch, which stops peeking from working
since the effect (exchange pipeline) isn't actually executed
on the spot. In such a case the queue is flushed later which
can lead to undefined behaviour, e.g. looping onOperationEnd,
which means that we think a query is active while it's not.
Instead we want to apply the operation queuing only to
client.reexecuteOperation, which is what's called from inside
exchanges.
The new behaviour: We now queue up operations from
reexecuteOperation when we're currently dispatching another
operation. Otherwise every operation executes immediately.