This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
Race condition when shutting down executor/transport channel #785
Labels
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
ClientContext
collects background resources to close after theClientContext
is closed:ExecutorService
(ExecutorAsBackgroundResource
)TransportChannel
When
GrpcOperationsStub#close()
is called, it callsshutdown()
on an aggregation of theExecutorService
andTransportChannel
which callsshutdown()
on these resources in order. Sinceshutdown
does not block and initiates a graceful shutdown, it's possible that theExecutorService
is terminated before theTransportChannel
finishes (race condition).We should probably
awaitTermination
on theTransportChannel
before trying to shutdown the executor.See googleapis/google-cloud-java#5810
The text was updated successfully, but these errors were encountered: