Redirect error msg responses without sessionId to all sessions and the connection #985
+45
−0
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.
Description of changes
If we receive an error response with an
id
, but nosessionId
, there's a slim chance that this response should be redirected to asession
but it will instead be redirected to theconnection
's event loop. This means that there is a chance that we could end up with a handler that is waiting for a response indefinitely (or until a timeout occurs).Since we have no knowledge of the
sessionId
from the response msg, we're now sending it to all livesession
s as well as theconnection
's event loop.Most handlers should ignore the extra error message, whilst the handler waiting for the msg (with the unique
msgId
) will action on it. If no handlers are alive or the associatedsession
has already been closed, then no handlers will action on it still since we're now working with uniquemsgId
s at the connection scope level.Checklist