@Override
public void onNext(...) {
try {
// do stuff
} catch (Exception ex) {
responseObserver.onError(ex);
}
}
This fixed the problem, but it raised the following questions:
1. Do I really need to catch all exceptions and explicitly call onError() ? Uncaught exception does not abort the call?
2. I would expect the call to time out at some point. It would be really *really* undesirable to leave both the client and the server in a zombie state. The timeout does not seem to be happening.
Please advise. Thanks.
Eugene
2. I would expect the call to time out at some point. It would be really *really* undesirable to leave both the client and the server in a zombie state. The timeout does not seem to be happening.
I'm not setting explicit timeout on the client. It would be too error-prone to set it on every call.
Is there a way to set default timeout on either the client or the server?
On Wednesday, December 14, 2016 at 5:11:37 PM UTC-8, Nathaniel Manista wrote:On Wed, Dec 14, 2016 at 5:08 PM, Eugene Strulyov <eugene....@gmail.com> wrote:2. I would expect the call to time out at some point.
It would be really *really* undesirable to leave both the client and the server in a zombie state.
The timeout does not seem to be happening.
If an exception is thrown in a StreamObserver, it will be caught in the JumpToApplicationThreadServerStreamListener and cause the stream to be closed. Eventually the exception will propagate back back to the serializing executor contained in the Server, which will log the exception.
Server side deadlines are set before the ServerInterceptors are added. These are normally derived from the deadline provided by the client. You can add your own ServerInterceptor to add a deadline if you would like, though.