line / armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
https://armeria.dev
Apache License 2.0
4.83k stars 921 forks source link

RxJava hooks does not propagate exception raised while pushing #3996

Open minwoox opened 2 years ago

minwoox commented 2 years ago

For example: https://github.com/line/armeria/blob/master/rxjava2/src/main/java/com/linecorp/armeria/common/rxjava2/RequestContextSingleObserver.java#L42 We should do something like:

@Override
public void onSubscribe(Disposable d) {
    if (!DisposableHelper.validate(disposable, d)) {
        return;
    }
    disposable = d;
    try (SafeCloseable ignored = assemblyContext.push()) {
        actual.onSubscribe(this);
    } catch(Throwable t) {
        d.dispose();
        actual.onError(t);
    }
}
minwoox commented 2 years ago

/cc @jupiny