Describe the bug
This bug has been observed on a deployed agent on AWS attempting to connect to a local agent that has been stopped. The deployed agent continuously logs the message INFO:ConnectionForward [host]:[port]:Starting Connection Forward (where the host and port are those of the local agent that was shut down until the deployed agent eventually stops. There appears to be some sort of infinite loop here.
...
| 2022-07-13T16:29:58.863+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:30:19.864+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:30:40.865+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:31:01.880+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:31:22.858+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:31:43.874+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:32:04.858+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:32:25.855+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
| 2022-07-13T16:32:46.858+10:00 | INFO:ConnectionForward 120.18.194.227:3806:Starting Connection Forward
...
To Reproduce
- Connect to a deployed agent (
npm run polykey -- agent start --seednodes="[deployedAgentNodeId]@[deployedAgentHost]:[deployedAgentPort] --verbose --format json)
- At some point after a connection is established kill the local agent
Expected behavior
We do not expect to see any sort of infinite looping or reconnecting. If an agent goes offline we shouldn't continue trying to re-connect to it.
Tasks
Describe the bug
This bug has been observed on a deployed agent on AWS attempting to connect to a local agent that has been stopped. The deployed agent continuously logs the message
INFO:ConnectionForward [host]:[port]:Starting Connection Forward(where the host and port are those of the local agent that was shut down until the deployed agent eventually stops. There appears to be some sort of infinite loop here.To Reproduce
npm run polykey -- agent start --seednodes="[deployedAgentNodeId]@[deployedAgentHost]:[deployedAgentPort] --verbose --format json)Expected behavior
We do not expect to see any sort of infinite looping or reconnecting. If an agent goes offline we shouldn't continue trying to re-connect to it.
Tasks
NodeIdString->{lastAttempt: number, delay: number}.findNodeandgetClosestGlobalNodes. We may want the ability to ignore these offline nodes or check every time. So we can add a flag to toggle skipping these nodes.getClosestGlobalNodeswhen pinging nodes.