-
Notifications
You must be signed in to change notification settings - Fork 27
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
StatsdClient should implement RefUnwindSafe
#77
Comments
Thanks for the issue! I'll start looking into this. Seems like it may be a little tricky since |
The two places that prevent the client from being panic safe are both in the I've replaced the use of The other place that prevents |
Make sure that the StatsdClient is unwind (panic) safe by ensuring that pointers to sinks and error handlers require the object to be unwind safe. Make the QueuingMetricSink unwind safe by not using a CondVar and Mutex but instead using an AtomicBool to indicate when the worker is stopped. Additionally, assert that the Crossbeam MsQueue is unwind safe because it implements Sync. See rust-lang/rust#54768 Fixes #77
Make sure that the StatsdClient is unwind (panic) safe by ensuring that pointers to sinks and error handlers require the object to be unwind safe. Make the QueuingMetricSink unwind safe by not using a CondVar and Mutex but instead using an AtomicBool to indicate when the worker is stopped. Additionally, assert that the Crossbeam MsQueue is unwind safe because it implements Sync. See rust-lang/rust#54768 Fixes #77
All
Sync
types should also implementRefUnwindSafe
as the former implies the latter.The
StatsdClient
currently does not implementRefUnwindSafe
because it stores two trait objects:The
RefUnwindSafe
bound should be added to both of these:And then the client will automatically become
RefUnwindSafe
itself.The text was updated successfully, but these errors were encountered: