Skip to content

fix(RDGRS-662): server side keep alive#19

Merged
OS-henriquesantos merged 5 commits into
masterfrom
RDGRS-662-fix-server-keep-alive
Aug 13, 2024
Merged

fix(RDGRS-662): server side keep alive#19
OS-henriquesantos merged 5 commits into
masterfrom
RDGRS-662-fix-server-keep-alive

Conversation

@OS-henriquesantos

Copy link
Copy Markdown

From chisel#442. Not tested

From chisel#442 . Not tested
@OS-henriquesantos OS-henriquesantos marked this pull request as draft August 6, 2024 17:15
@OS-henriquesantos

Copy link
Copy Markdown
Author

Tested this locally successfully.

Testing environment:

  • Chisel docker container
  • Outsystems Cloud Connector container
  • Echo server container
docker run -d -p 7777:80 ealen/echo-server
docker run -it --rm --name chisel -p 8989:8989 -p 8888:8888 jpillora/chisel:1.9.1 server --port=8989 --reverse -v
docker run --name cloud-connector --rm -it ghcr.io/outsystems/outsystemscc:1.3.3 -v 172.17.0.1:8989 R:8888:172.17.0.1:7777

Without the fix, we could disconnect cloud connector with docker network disconnect bridge cloud-connector and then both chisel and CC would only detect the dropped connection after 15 minutes:

# docker
$ date && docker network disconnect bridge cloud-connector
Fri Aug  9 14:00:33 WEST 2024

# chisel
2024/08/09 13:16:21 server: session#1: tun: SSH disconnected
2024/08/09 13:16:21 server: session#1: tun: Unbound proxies
2024/08/09 13:16:21 server: session#1: Closed connection
2024/08/09 13:00:05.878 GET / 200 16m15s (172.17.0.1)
# cloud-connector
2024/08/09 13:14:52 client: tun: SSH disconnected
2024/08/09 13:14:52 client: Disconnected
2024/08/09 13:14:52 client: Connection error: read tcp 172.17.0.5:41100->172.17.0.1:8989: read: connection timed out
2024/08/09 13:14:52 client: Retrying in 100ms...
2024/08/09 13:14:52 client: Connection error: dial tcp 172.17.0.1:8989: connect: network is unreachable (Attempt: 1/unlimited)
2024/08/09 13:14:52 client: Retrying in 200ms...
(...)

When running a local image of chisel with this PR, chisel detects the dropped connection at most 30 seconds running with keep-alive set at 10s:

# docker 
$ date && docker network disconnect bridge cloud-connector
Fri Aug  9 17:11:07 WEST 2024

# chisel with fix
2024/08/09 16:11:17 server: session#1: tun: SSH disconnected
2024/08/09 16:11:17 server: session#1: tun: Unbound proxies
2024/08/09 16:11:17 server: session#1: Closed connection (read tcp 172.17.0.3:8989->172.17.0.1:37854: use of closed network connection)
2024/08/09 16:10:57.456 GET / 200 20s (172.17.0.1)

Since the used CC image does not have the fix, it continues stuck for 15 mins. It is expected that once the chisel dependency with this fix is updated there, that it will also detect this quickly.

@OS-henriquesantos OS-henriquesantos marked this pull request as ready for review August 12, 2024 10:18
Comment thread share/tunnel/tunnel.go
* feat(RDGRS-662): build image

* feat(RDGRS-662): restore test CI and dependabot

* feat(RDGRS-662): test CI only on linux

* feat(RDGRS-662): add version to goreleaser
@OS-henriquesantos OS-henriquesantos requested a review from a team as a code owner August 12, 2024 15:20
@OS-henriquesantos OS-henriquesantos merged commit bd9460b into master Aug 13, 2024
@OS-henriquesantos OS-henriquesantos deleted the RDGRS-662-fix-server-keep-alive branch August 13, 2024 16:38
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