-
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
If the frame handler thread is null do not schedule it on the executor #11651
Conversation
…r. Fixes NPE from grpc#11503.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the latch/barrier handling needs to move into the try-catch that guarantees clientFrameHandler
is set. So if the second thread fails, we'll use the source with "Use closed source on failure so that the reader immediately shuts down."
…ailed 2nd thread scheduling.
Only the source is guaranteed to be set after a certain point, so I think you mean source and not clientFrameHandler. I have pushed a commit with an attempt, although some other tests need fixing that fail with a NPE. |
Assigning grpc-java/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java Lines 593 to 594 in a431e36
|
The case causing NPE for clientFrameHandler is this latch.await() timing out and sending a go away for internal error. How could this code be moved after clientFrameHandler is initialized in finally, because I thought we had to wait for connection preface settings to be sent first. |
Move it into the try block, so if it fails |
Got it, I wrongly assumed you were implying changing the order of the statements and got confused, you were only suggesting expanding the try scope to include the latch and barrier await. Pushed the commit. |
Fixes NPE from "Detect transport executors with no remaining threads #11503".