What version of gRPC-Java are you using?
master
What is your environment?
Android
Steps to reproduce the bug
- Create a binder Server using a fake AsyncSecurityPolicy and a custom Executor
- Create a Channel to that Server and send a call.
- Observe a check authorization request to your security policy. Return a pending SettableFuture.
- Call shutdownNow() on the server.
- Wait for server.awaitTermination() to return.
- Call shutdown() on the custom Executor.
- Complete the future from (3)
What did you expect to see?
Call fails with UNAVAILABLE / "Server shutdownNow invoked".
What did you see instead?
RejectedExecutionException
This is a resource leak at least, but not a permanent one, assuming checkAuthorization()s calls eventually return and checkAuthorizationAsync() futures eventually complete. More serious is that the Listeners we install on these futures are set to run on the Server's executor. In the custom Executor case, this is only valid until the Server is terminated (after that the app is allowed to shut it down). And if we're using the grpc-default-executor, it's only valid until BinderServer returns it to the pool in onTerminated().
What version of gRPC-Java are you using?
master
What is your environment?
Android
Steps to reproduce the bug
What did you expect to see?
Call fails with
UNAVAILABLE/ "Server shutdownNow invoked".What did you see instead?
RejectedExecutionException
This is a resource leak at least, but not a permanent one, assuming checkAuthorization()s calls eventually return and checkAuthorizationAsync() futures eventually complete. More serious is that the Listeners we install on these futures are set to run on the Server's executor. In the custom Executor case, this is only valid until the Server is terminated (after that the app is allowed to shut it down). And if we're using the
grpc-default-executor, it's only valid untilBinderServerreturns it to the pool inonTerminated().