-
Notifications
You must be signed in to change notification settings - Fork 617
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
grpc-js: Unref backoff timer in subchannel #2586
grpc-js: Unref backoff timer in subchannel #2586
Conversation
We found that in 1.9.4 with this unref if you write a script that makes a gRPC call and displays the output, the script might terminate (successfully) before the actual execution of the request, because it no longer waits for this timer.
but if we start some timer manually before calling some method with something like setTimeout(() => {
console.log('timed out');
}, 5000); then everything is ok because our process will wait for our timer |
@silentroach Please test this with the latest version (1.9.12) and then if the problem persists, file an issue. |
Yep, the same problem in 1.9.12, will file an issue, thank you |
This was making the tests taking a long time to exit after finishing. Our general principle is that grpc should keep the process open if and only if there is a pending request or other surface API event (e.g. channel state change). If a call is not assigned to a connection, the channel has a timer that keeps the process open, and if the call is assigned to a connection, the corresponding transport keeps the connection open. Either way, the subchannel is never responsible for that, so it should unref any timers or other handles that it owns.