Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exception in fiber prints stack trace twice #156

Closed
mikehearn opened this issue Feb 5, 2016 · 2 comments
Closed

Exception in fiber prints stack trace twice #156

mikehearn opened this issue Feb 5, 2016 · 2 comments
Assignees
Labels

Comments

@mikehearn
Copy link
Contributor

If I throw an exception from inside a fiber, there is an issue with redundant logging. I expect the framework to just surface the exception by rethrowing it at the point where I started or resumed this fiber, which it does, but it also runs the Fiber.defaultExceptionHandler ... twice. This results in stderr spam. I'd rather it printed nothing at all and let the exception propagate out of the fiber like any other.

@circlespainter circlespainter self-assigned this Feb 6, 2016
@pron
Copy link
Contributor

pron commented Feb 7, 2016

A Fiber is both a thread (in the abstract sense) and a j.u.c.Future. As a Future, it is required to throw any exceptions when it is joined (Future.get), and as a thread it is required to log any uncaught exception, as it may never be joined. But precisely for that reason we have Fiber.setDefaultUncaughtExceptionHandler/Fiber.setUncaughtExceptionHandler, so that you can turn this behavior off.

If the exception handler is called twice, that is, indeed, a bug. We'll look into that.

@pron pron added the bug label Feb 14, 2016
@pron
Copy link
Contributor

pron commented Feb 21, 2016

Should be fixed now (i.e. exception should only be printed once). You can get the new version from the 0.7.0 branch or 0.7.5-SNAPSHOT on Sonatype.

@pron pron closed this as completed in 4162f1f Feb 21, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants