Skip to content

bug: Jetbrains Gateway ssh sessions do not close #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
f0ssel opened this issue Oct 29, 2024 · 0 comments
Open

bug: Jetbrains Gateway ssh sessions do not close #179

f0ssel opened this issue Oct 29, 2024 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@f0ssel
Copy link

f0ssel commented Oct 29, 2024

Jetbrains Gateway creates many ssh sessions to connect to coder workspaces. After some digging into the underlying behavior, I've noticed that Jetbrains Gateway plugin will create ssh sessions when opening an IDE to a workspace and upon closing the IDE the ssh connections will be held open until the gateway client is closed.

After opening and closing the IDE to a workspace you can see the ssh session open still:

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=

Because these are held open they will continue to bump workspace activity indefinitely despite no active IDE session to the workspace. While collaborating with @code-asher we were able to isolate this behavior down to to Jetbrains Gateway (not our plugin code) and @code-asher is filing a bug with Jetbrains directly with our reproduction steps. We've ruled out that this could be related to coder ssh by reproducing this issue with a regular ssh command in the ProxyCommand config and still seeing the same issue.

In legacy workspace activity tracking we solved this by tracking the port-forward session at the agent ssh server and this is accurately tracking usage today. In the new workspace activity system this behavior is a problem because we rely on the client sending us activity updates, and if the client is incorrectly holding open ssh connections for hours on end we can't tell from our side that this activity update is invalid and we will continue to record activity to the workspace long after the IDE has been closed.

@f0ssel f0ssel self-assigned this Oct 29, 2024
@coder-labeler coder-labeler bot added the help wanted Extra attention is needed label Oct 29, 2024
@f0ssel f0ssel changed the title bug: jetbrains gateway ssh sessions do not close bug: Jetbrains Gateway ssh sessions do not close Oct 29, 2024
@f0ssel f0ssel added this to the Workspace Activity Refactor milestone Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant