-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Exception not thrown from interval with blank onError #1585
Comments
The exception is getting thrown but |
OK, thank you. Any progress on this issue will be greatly appreciated. |
Related to #1682 |
@dvtomas I have finished #1682. There isn't much that can be done other than output logs to System.err if exceptions are allowed to propagate without anything catching them (as your examples do) but at least now they won't fail silently. Can you please review #1682 and let me know if you have any better suggestions? Here is an example: Observable.interval(100, TimeUnit.MILLISECONDS).map(i -> {
throw new RuntimeException("fail!");
}).subscribe();
Thread.sleep(1000); now outputs
|
I have had a look at #1682. I haven't tested it because it seems that rxjava-scala RCs haven't been released to Maven yet. My original use case was that I have some observables I know should never fail. If they do, it means that some unhandled exception has been thrown in my code, and it is definitely a bug that should be resolved. In the same spirit as a bug in ordinary code results in an exception being thrown and thus immediate feedback to the developer, I have expected an exception in reactive code to do the same. Now that I see all the troubles with this issue, I think I'll change my approach to subscribing to observables. I'll just implement a special error handler for handling these "never-failing" observables, and pass it to them during subscribing. This handler could log the error, or try to somehow pass it to the main thread where it could be raised, or anything else. So, for me, your improvement with stack trace print will be a huge help especially during the transition to the handle-everything approach, but other than that I'll just work around this issue with this special handler. So, as far as I am concerned, I'm happy with your fix and current state of affairs. Thank you, regards, @dvtomas |
Thanks for the feedback. |
@benjchristensen I have numerous occurrences of this crash throughout my application. However, I am finding it extremely difficult to hunt down the source of these crashes, since the stack trace does not lead back to my client code. Do you have any tips for tracking the source down, given that I have a pretty large codebase that is using schedulers, intervals, observeOns, etc., all over the place? |
I responded to your question in the issue you opened: #2293 (comment) |
Hi all,
this one (and probably some other similar bugs) has been biting me badly last couple of weeks.
RxScala 0.20.0-RC5. Let's have
then
throws a RuntimeException as expected, but
does not. I'd expect it to throw an exception as well, albeit probably in a different thread.
Thank you, best regards,
Tomáš Dvořák
The text was updated successfully, but these errors were encountered: