[Broker/Client] Close connection if a ping or pong message cannot be sent - #15382
Merged
lhotari merged 2 commits intoApr 29, 2022
Merged
Conversation
- the connection should be closed if a ping message cannot be sent
lhotari
requested review from
BewareMyPower,
codelipenghui,
eolivelli,
merlimat,
michaeljmarshall and
nicoloboschi
April 29, 2022 06:25
BewareMyPower
approved these changes
Apr 29, 2022
nicoloboschi
approved these changes
Apr 29, 2022
Member
Author
|
I added similar handling for the Pong message. |
lhotari
added a commit
to datastax/pulsar
that referenced
this pull request
Apr 29, 2022
…sent (apache#15382) * [Broker/Client] Close connection if a ping message cannot be sent - the connection should be closed if a ping message cannot be sent * Handle write errors for pong messages (cherry picked from commit 2ddef95)
lhotari
added a commit
to datastax/pulsar
that referenced
this pull request
Apr 29, 2022
…sent (apache#15382) * [Broker/Client] Close connection if a ping message cannot be sent - the connection should be closed if a ping message cannot be sent * Handle write errors for pong messages (cherry picked from commit 2ddef95)
lhotari
added a commit
to datastax/pulsar
that referenced
this pull request
Apr 29, 2022
…sent (apache#15382) * [Broker/Client] Close connection if a ping message cannot be sent - the connection should be closed if a ping message cannot be sent * Handle write errors for pong messages (cherry picked from commit 2ddef95)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 9, 2022
…sent (apache#15382) * [Broker/Client] Close connection if a ping message cannot be sent - the connection should be closed if a ping message cannot be sent * Handle write errors for pong messages (cherry picked from commit 2ddef95) (cherry picked from commit 5da1637)
This was referenced Jun 2, 2022
11 tasks
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The keep alive implementation used in the Broker and the Java client ignores any failures that happen while writing the Ping message.
In Netty 4+, it's necessary to add a listener to detect failures when writing to outbound channels.
The connection should be closed if a ping message cannot be sent. The future is notified once the OS level TCP/IP stack accepts the message for delivery.
This change will help detect the situation where writing to the outbound channel returns EBADF errno from the OS level and the connection isn't yet completely closed.
EBADF errno maps to java.nio.channels.ClosedChannelException which has this kind of explanation:
Modifications