Fix: Handle out-of-order Configure responses #275
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.
Out of order configure responses for two concurrent configure requests result in using already deleted handle.
Current code relies on the order of responses being the same as requests.
Consider two queue handles: 0x7febbca192f0 and 0x7febbca13200.
The context for configure request for the first one references both handles. This is RelayQE, so it maintains downstream and upstream views.
Before the configure response, comes de-configure request for the second one, followed by close request, resulting in the second one destruction.
Now, the configure response for the first one gets processed and its context attempts to access already deleted he second one.