grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

BinderTransports may report transportTerminated() despite unfinished work in Executors

Open jdcormie opened this issue 3 months ago • 0 comments

For example, BinderClientTransport delays transportTerminated() until all in-flight calls complete but it doesn't consider all the work it may have enqueued on all the various Executors. We should either cancel all these tasks or wait for them to complete before declaring the transport terminated. That's because the higher layer ManagedChannel contract implies/says that all these Executors can be shutdown after termination. There are two cases:

  • ExecutorService#shutdownNow() - our Runnables could be returned from shutdownNow() without having executed. Callers of execute don't really expect this. I can imagine it could cause a resource leak.
  • ExecutorService#shutdown() - less likely to be a problem.

BinderServerTransport seems to have the same problem.

jdcormie avatar Sep 22 '25 21:09 jdcormie