dpc / mioco.pre-0.9

Scalable, coroutine-based, asynchronous IO handling library for Rust programming language. (aka MIO COroutines).
Mozilla Public License 2.0
457 stars 30 forks source link

Catch Panic Configuration #85

Closed Drakulix closed 8 years ago

Drakulix commented 8 years ago

This PR adds runtime configuration of catching panics.

When no catching is enabled, that panic is actually still catched, because coroutine-rs does execute the init_fn in a foreign function context, causing a SIGILL if a panic would occure. Instead the panic is then passed to the mio::EventLoop, where it is propageted to get a nice backtrace.

Panic catching is configurable through the Config struct, but the actual flag is passed into each coroutine to be able to read it inside the Coroutine::spawned function.

Additionally sending the panic requires the thread_id to access the right Mio::Sender, which was added to HandlerShared.

dpc commented 8 years ago

Something went wrong and the hang seems real. I'm investigating if it was your patch, or previously unknown problem.

dpc commented 8 years ago

Travis failed without your patch. So something else, it seems.

Drakulix commented 8 years ago

I have answered all your comments. Once that travis build error is sorted out, I will push the name and comment changes to trigger a new build.

dpc commented 8 years ago

Travis hanged, looks like the existing issue yet to be fixed, so merged. Thanks!