-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Executor usage in ClientCallImpl
races with channel shutdown and termination.
#1981
Comments
We should not miss out the case where a new call is created, the channel is terminated, then the call is started. Simply resetting the executors in channel upon termination doesn't help with this case, because the call holds on to the executors. |
|
newCall()
races with channel shutdown and termination.ClientCallImpl
races with channel shutdown and termination.
@ejona86 @dapengzhang0, I wonder if the fix should be:
|
@zhangkun83, I'm not sold on (2), but even if I was favorable toward it, it does seem like an API breakage. |
ManagedChannelImpl
clearscheduledExecutor
inshutdown()
, and releases (which potentially closes)executor
inmaybeTerminateChannel()
.Neither
newCall()
norClientCallImpl
checks the shutdown state of the channel.ClientCallImpl
relies onFailingClientTransport
for the expected behavior. However,ClientCallImpl
uses the passed in executors anyway, for scheduling the deadline timer and invoking the call listener.If
ClientCallImpl
tries to schedule a deadline timer after the channel is shut down, it will get a NPE. If it runs the call listener after the shared executor has been closed, which is 1 second (SharedResourceHolder.DESTROY_DELAY_SECONDS
) after all references are gone, e.g., the application callsCall.start()
that late, it will get aRejectedExecutionException
. Our current tests are not testing for the two cases.This doesn't seem to be a serious issue. It only affect people who try to use
Call
s after the channel has been shutdown. I am yet to figure out a solution.Anyway, it seems
executor
should be cleared after being returned to the shared pool, likescheduledExecutor
.The text was updated successfully, but these errors were encountered: