-
Notifications
You must be signed in to change notification settings - Fork 1.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
Expose TCP connection establishment information #9529
Comments
This issue has been automatically marked as stale because it has been a |
Hello, |
@arsenalzp I don't think it's too complex, so you can give it a go. You can start by finding the place in the code that initiate connection establishment, the place where the connection establishment is complete, and the place where the connection establishment is failed. Then it's a matter of designing the listener APIs, and then emitting the events. Let me know if you need guidance, but please one at a time 😄 Thanks! |
I guess the right place is in
A draft implementation is showing
|
@arsenalzp We want to track connection establishment, so we want an event when the connection is initiated, and one when it is completed (either success or failure). The API should be lower level, so:
|
I found a connection behaviour,
|
@arsenalzp good finding! Can you please check that in the "begin" event, you get two different We should get 2 "begin" events and 2 "failure" events and 0 "success" events. |
Yes, of course, there two different However, it is not possible to get local address when channel is not connected (connection state is pending), meanwhile it is possible to get remote address, check a channel state, etc. Moreover, calling My expectation is that bind operation is the first one before any connection attempt. Obviously, connection can't be established without binding to local address and port, so this operation is done somewhere else (
It means getting It is still possible to get local address on successful connection event. |
/assign |
Introduced ClientConnector.ConnectListener with events for TCP connection establishment/failure. Signed-off-by: Oleksandr Krutko <[email protected]>
Cleaned up contribution by @arsenalzp. Added more test cases for blocking and non-blocking. Signed-off-by: Oleksandr Krutko <[email protected]> Signed-off-by: Simone Bordet <[email protected]>
Jetty version(s)
10+
Enhancement Description
Would be nice to have
HttpClient
(or some other component such asClientConnector
) emit events for TCP connection establishment/failure (a begin event, and a success/fail event, for a givenSocketAddress
).This could be useful to track destination servers that are faulty or take a long time to establish a connection.
The text was updated successfully, but these errors were encountered: