-
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
Stop allocating an Exception on Channel shutdown #10524
Comments
CC @ejona86, he may have some comments about why this was added. |
Oh, this is a different one than I thought. I thought you had discovered ManagedChannelOrphanWrapper, which is on the channel creation flow. grpc-java/core/src/main/java/io/grpc/internal/ManagedChannelOrphanWrapper.java Lines 100 to 103 in d15daed
I'm surprised you noticed this one and not the ManagedChannelOrphanWrapper exception. Why would this one be more noticable? |
Regarding ClientTransportLifecycleManager, I think it'd probably be better to just get rid of the We should make |
We did, but we disabled
I'll only be able to check on Thursday, sorry. I've been busy tracking other Exceptions allocations when closing a channel. It turns out there's also a bug in Netty, netty/netty#13569, whose consequences are even worse in grpc-netty when using |
What version of gRPC-Java are you using?
The latest
What is your environment?
Not relevant
What did you expect to see?
Not an Exception being allocated every time a Channel gets closed.
What did you see instead?
ClientTransportLifecycleManager#notifyShutdown
callsStatus#asException
that allocates an Exception for the sake of being able to track wherenotifyShutdown
was called from. To my understanding, this is a debugging feature, nothing in gRPC's logic requires it.This generates a lot of allocations when allocation lots of channels for load testing purpose.
Could it be possible to deactivate this feature with a System property? And possibly deactivate it by default if it's indeed only used for debugging and changing it is not considered a breaking change.
Steps to reproduce the bug
Not relevant
The text was updated successfully, but these errors were encountered: