question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it assumed that CompositeException is eligible to modify the cause of exceptions passed in constructor of CompositeException?

See original GitHub issue

Since RxJava modifies exceptions during call of getCause method of CompositeException instance and connect these exceptions in chains we have finally millions of exceptions and quickly getting out of memory.

    @Test
    public void compositeExceptionIssue() {
        Single
            .just(new Throwable("ROOT ERROR"))
            .flatMapCompletable(rootError -> Observable
                .range(1, 10)
                .flatMapCompletable(testNumber -> Completable
                    .mergeArrayDelayError(
                        Completable.error(new RuntimeException("Test#" + testNumber + "A", rootError)),
                        Completable.error(new RuntimeException("Test#" + testNumber + "B", rootError))
                    )
                    .doOnError(Throwable::getCause)
                    .onErrorComplete()
                )
                .doOnComplete(() -> {
                    rootError.printStackTrace();
                })
            )
            .blockingAwait();
    }

This simple test demonstrates that cause of rootError throwable is changed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
akarnokdcommented, Dec 6, 2019

Thanks for reporting. This is a shortcoming of the 1.x and 2.x composite design and I’m afraid we can only resolve this for 3.x because it is a breaking change in the structure of the composite verified by unit tests.

0reactions
akarnokdcommented, Dec 5, 2019

I see. To resolve it, we’d have to remove the custom getCause implementation otherwise it will keep touching all sorts of inner exceptions. We could also probably fake a StackTraceElement array containing all inner exceptions too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it assumed that CompositeException is eligible to modify the ...
Since RxJava modifies exceptions during call of getCause method of ... the cause of exceptions passed in constructor of CompositeException?
Read more >
CompositeException (RxJava Javadoc 3.1.5) - ReactiveX
Represents an exception that is a composite of one or more other exceptions. A CompositeException does not modify the structure of any exception...
Read more >
java - io.reactivex.exceptions.CompositeException ...
The actual exception thrown is a CompositeException , so that is why it doesn't match ExceptionHandler<GlobalException, HttpResponse> .
Read more >
Exception Handling & Assertion in Java
Exception Handling. 1.1 Introduction. An exception is an abnormal event that arises during the execution of the program and disrupts the normal flow...
Read more >
Essentials - Julia Documentation
Julia 1.5 is required for passing the mapexpr argument. source Base.include_dependency — Function. include_dependency(path::AbstractString).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found