Skip to content
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

Fix an RPCResponseDispatcher crash on clear #670

Merged
merged 1 commit into from
Jul 31, 2017

Conversation

joeljfischer
Copy link
Contributor

Fixes #666

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Will not be unit tested

Summary

This PR changes how the SDLRPCResponseDispatcher clear method works. Currently, before clearing all of its dictionaries, it will run through its list of RPC response handlers and call all existing handlers with an error. We've come across a case where this response handler map could be mutated while being iterated, and this is a crash. To fix this, this PR uses an immutable dictionary copy of the response handler map and iterates over that. This will not be a performance hit because clear is not often called, and never in performance intensive situations.

Changelog

Bug Fixes
  • Fix a rare crash when disconnecting and connecting quickly.

CLA

@joeljfischer joeljfischer added the bug A defect in the library label Jul 28, 2017
@joeljfischer joeljfischer added this to the 4.7.0 milestone Jul 28, 2017
@joeljfischer joeljfischer self-assigned this Jul 28, 2017
@joeljfischer joeljfischer requested a review from BrettyWhite July 28, 2017 19:00
@joeljfischer joeljfischer changed the base branch from master to develop July 28, 2017 19:00
@joeljfischer joeljfischer merged commit 54b77fd into develop Jul 31, 2017
@joeljfischer joeljfischer deleted the bugs/issue_666_responsedispatcher_crash branch July 31, 2017 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants