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

Bunny raises asynchronous exceptions on the thread that opened the connection #597

Closed
bbascarevic opened this issue Aug 13, 2020 · 3 comments

Comments

@bbascarevic
Copy link
Contributor

bbascarevic commented Aug 13, 2020

Bunny is raising asynchronous exceptions using Thread#raise in the thread that happened to call Session#start. This introduces a potentially dangerous and unpredictable behavior as the asynchronous exception (interrupt) can happen at any point in the thread lifetime, even in an ensure section, and is effectively impossible to defend against.

The proposal is to provide means to specify a session_error_handler object that implements #raise, which if specified would be used instead of the origin thread, otherwise it would fall back to origin thread for backwards compatibility.

https://github.com/bbascarevic-tti/bunny/commit/4b282030bece8ecbfd250c5d39f381640066c03c

@michaelklishin
Copy link
Member

Sounds reasonable. Please submit a PR?

michaelklishin added a commit that referenced this issue Aug 13, 2020
Fixes #597 - Session error handler object which responds to #raise
@bbascarevic
Copy link
Contributor Author

@michaelklishin Any estimates on when 2.16.0 might land on rubygems?

@michaelklishin
Copy link
Member

2.16.1 is out. I had to yank 2.16.0 because I did not pull master before cutting it on this specific machine 🤦‍♂️ 🤦‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants