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

Add ConnChecker to customize conn health check #3060

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pragkent
Copy link

Allow user to customize conn health check.

One of the scenario we met is that we'd like to drain some proxy node before upgrading. If we'd like to take down some node, instructions could be sent to clients to drop connections to these nodes.

@monkey92t
Copy link
Collaborator

monkey92t commented Jul 17, 2024

You should use the Option.Dialer property instead, compared to ConnCheck, as it can create the network connection you want, as long as it conforms to the net.conn interface.

ConnCheck checks *tls.Conn and syscall.Conn interfaces and uses RawConn to check connection health. You can implement the syscall.Conn interface in custom network connections to achieve this purpose.

@pragkent
Copy link
Author

You should use the Option.Dialer property instead, compared to ConnCheck, as it can create the network connection you want, as long as it conforms to the net.conn interface.

ConnCheck checks *tls.Conn and syscall.Conn interfaces and uses RawConn to check connection health. You can implement the syscall.Conn interface in custom network connections to achieve this purpose.

That should work, I'll try. Thanks.

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.

2 participants