Skip to content

fix(shell): end SSH console sessions when the channel closes - #3186

Open
holgerfriedrich wants to merge 1 commit into
apache:mainfrom
holgerfriedrich:pr-console-exceptions
Open

holgerfriedrich wants to merge 1 commit into
apache:mainfrom
holgerfriedrich:pr-console-exceptions

Conversation

@holgerfriedrich

Copy link
Copy Markdown
Contributor

When an SSH client disconnects while a command is running (e.g. less or log:tail), the console session is never closed: destroy() only closes the SSH session. The console thread then waits for the command forever, or, once it returns, spins at 100% CPU because every prompt fails with an IOError on the closed channel and readCommand() prompts again.

Close the console session when the channel is destroyed, and end the session in readCommand() when the terminal fails with an IOError.

Fixes #3185.

This PR was created with AI support.

When an SSH client disconnects while a command is running (e.g. less
or log:tail), the console session is never closed: destroy() only
closes the SSH session. The console thread then waits for the command
forever, or, once it returns, spins at 100% CPU because every prompt
fails with an IOError on the closed channel and readCommand() prompts
again.

Close the console session when the channel is destroyed, and end the
session in readCommand() when the terminal fails with an IOError.
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown

Test Results

1 140 files  +8  1 140 suites  +8   1h 25m 45s ⏱️ -18s
1 403 tests +2  1 272 ✅ +2  131 💤 ±0  0 ❌ ±0 
5 612 runs  +8  5 086 ✅ +8  526 💤 ±0  0 ❌ ±0 

Results for commit e8d178d. ± Comparison against base commit 101e79b.

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.

SSH console thread spins at 100 % CPU or leaks after client disconnect

2 participants