coder / coder/internal

bug: Jetbrains Gateway opens multiple primary ssh connections

Open
#180 0 comments 0 reactions 1 assignee Claimed by @f0ssel View on GitHub
help wanted
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Although we have a background ssh config that Jetbrains Gateway uses for admin actions, it will also open multiple connections under the primary hostname which reports activity while the connection is open. Because clients like Jetbrains Gateway will open multiple of these connections for a single IDE session, we need to debounce the updates coming in from these multiple connections on the coder server so that we report this activity as just 1 jetbrains ssh session and not 2+.

It's possible that this is a Jetbrains Gateway bug and related to https://github.com/coder/internal/issues/179 - If the first connection sees an error and Jetbrains opens another connection (and leaves the old one open) you could see 2 ssh commands running when jetbrains is only using 1.

After opening the IDE you can see the following:
```
ps aux | grep -e "--usage-app="
f0ssel 28578 1.2 0.2 409780816 41840 ?? S 3:25PM 0:00.46 /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/coder-darwin-arm64 --global-config /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/config --url http://localhost:3000 ssh --stdio --disable-autostart --usage-app=jetbrains admin/jetbrains1.main
f0ssel 28502 0.7 0.2 409790336 37376 ?? S 3:25PM 0:00.45 /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/coder-darwin-arm64 --global-config /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/config --url http://localhost:3000 ssh --stdio --disable-autostart --usage-app=disable admin/jetbrains1.main
f0ssel 28595 0.6 0.2 409788496 40704 ?? S 3:25PM 0:00.21 /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/coder-darwin-arm64 --global-config /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/config --url http://localhost:3000 ssh --stdio --disable-autostart --usage-app=jetbrains admin/jetbrains1.main
f0ssel 28517 0.4 0.2 409780304 36384 ?? S 3:25PM 0:00.31 /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/coder-darwin-arm64 --global-config /Users/f0ssel/Library/Application Support/coder-gateway/localhost-3000/config --url http://localhost:3000 ssh --stdio --disable-autostart --usage-app=disable admin/jetbrains1.main
f0ssel 28695 0.0 0.0 408626896 1408 s001 S+ 3:25PM 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox -e --usage-app=
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.