-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent possibly unbound variable in history response handler #84
Conversation
I think I understand what you are trying to do, but I don't understand the comment.
I can only see the critical case happening when a client receives two successive messages with the same correlation id - which would be a bug in another agent, but sure, could happen - and the second |
Unfortunate wording. The local variable
Staring at the code and having
If I understand correctly what you are asking:
Yes, that is (probably) correct. It was just that the handling for "this is an unknown correlation ID" and "this response was handled already" were lumped together. I think that if a response future can be retrieved from I am not sure if the code under |
I
I'd argue it can't happen because
Ah I skimped over the |
When handling history responses, the local variable `future` might be unbound in the `HistoryError` handler. Split this in three steps to reduce error handling clutter: 1. Obtain future from correlation ID, which is possibly unknown 2. Check that this future is not already done, i.e. the response was not handled already 3. Parse history response, set result or exception of the response future accordingly
949abbc
to
3264972
Compare
When handling history responses, the response future in
future
might be unbound in theHistoryError
handler.Split this in three steps to reduce error handling clutter: