openconfig / grpctunnel

A TCP-over-gRPC Tunnel
Apache License 2.0
81 stars 24 forks source link

Target with two handrels can not reconnect to server #47

Closed dody closed 2 years ago

dody commented 3 years ago

Target with 2 handlers (tunnel_target) can connect to server but when it disconnects it cannot connect again to server.

To reproduce:

  1. Content of target.cfg:
    
    tunnel_server_default: <
    tunnel_server_address: "localhost:5555"
    >

tunnel_target: < target: "target1" type: "SSH" dial_address: "localhost:22"

tunnel_target: < target: "target1" type: "GNMI" dial_address: "localhost:9339"

  1. Start server:

    server -tunnel_address "localhost:5555"
  2. Start target:

    target  -config_file "target.cfg"
  3. kill target and start it again as in step 3.

Server log:

2021/11/12 14:05:35 handling target addition: (target1:SSH)
2021/11/12 14:05:35 handling target addition: (target1:GNMI)
2021/11/12 14:05:37 handling target deletion: (target1:SSH)

In server log there is missing:

Target is also not reachable from client.

jxx-gg commented 3 years ago

Thanks for pointing it out. https://github.com/openconfig/grpctunnel/pull/48 should fix the issue.