Skip to content

Register unused reverse tunnel for reuse

Mikhail Mazurskiy requested to merge ash2k/register-unused-tunnel into master

(routing) kas looks for tunnels in other (gateway) kas instances (and self). It then connects to 1 or more kas instances where a tunnel is found. Agents connect and disconnect, tunnels are used up and re-established. There are plenty of races and it can happen that routing kas has a connection established to more than one gateway kas. And it can happen that more than one connected gateway kas instances have suitable tunnels. Only one is selected by the routing kas.

Currently found but unused tunnels are closed by gateway kases. agentk then re-establishes them. With this change those tunnels are not closed but instead registered again with the registry and made available for use. This is an efficiency improvement.

Relates to #165 (closed).

Tested this locally with GDK and on staging: https://staging.gitlab.com/mmazurskiy/new-agents/-/jobs/43719618

Edited by Mikhail Mazurskiy

Merge request reports