This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Periodically re-resolve UDP server address, with opt-out (#520)
* Add resolved udp connection type, continually resolve dns names in background Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Be sure to set buffer bytes width on new connections. Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Lock when checking if resolved addr is new. Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fixes from review comments. Dont return error if UDPConn fails on startup Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fix failing test. Apparently the linux kernel returns the sockopt val doubled. Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Use atomic ops to manage bufferBytes instead of locking mutex Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fix buffer bytes assert because sock opt value is not guaranteed to be exactly twice set val Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Remove intermediate init helpers, initialize close chann in struct initialization Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fixes based on comments, more tests for udp_client.go, and test for write retry Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Run make fmt Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Remove unused struct field Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fix lint error Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add test for new conn established when host record changes Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Fix comment typo Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add test for failed write retry Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add test calling NewAgentClientUDP Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Remove sleep on last try evaluating connection condition Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Rename resolved udp conn to reconnecting udp conn, add opt-out option for reconnecting client and option for reconnect interval Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Remove irrelevant comment, fix transport max packet size regression Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add panic in case the test server listen or srv fails unexpectedly Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add coverage for new env vars Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Run make fmt Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Add back constants, add helper for generating a mock udp addr, require all assertions of udp write to succeed Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Remove local agent constants from utils Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca> * Move no error requirement into mock udp addr constructor Signed-off-by: Trevor Foster <trevor.foster@hotmail.ca>
- Loading branch information
Showing
11 changed files
with
1,023 additions
and
54 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.