Skip to content
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

Flag connection as unhealthy when underlying socket is closed. #5920

Merged
merged 1 commit into from Apr 4, 2020

Conversation

dave-r12
Copy link
Collaborator

@dave-r12 dave-r12 commented Apr 4, 2020

@dave-r12
Copy link
Collaborator Author

dave-r12 commented Apr 4, 2020

I believe this reproduces the issue reported in #5819. This is very subtle. I found that if we close the rawSocket in RealConnection (using cancel) it is not seen by the application layer socket if we are using SSL/TLS. So the health checks pass. When we later call newCodec it throws a SocketException. Since the connection is considered healthy this continues indefinitely.

val socket = this.socket!!
val source = this.source!!
if (socket.isClosed || socket.isInputShutdown || socket.isOutputShutdown) {
if (rawSocket.isClosed || socket.isClosed || socket.isInputShutdown ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@swankjesse swankjesse merged commit c1150b0 into master Apr 4, 2020
@yschimke
Copy link
Collaborator

yschimke commented Apr 4, 2020

Impressive detective work.

@dave-r12 dave-r12 deleted the health-raw-socket branch April 4, 2020 19:02
@yschimke
Copy link
Collaborator

yschimke commented Apr 4, 2020

I wonder whether this could solve a whole bunch of problems after network changes etc. I'm glad this made 4.5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants