Skip to content

[KARAF-2513] Fix log:tail thread leak on SSH disconnect#2514

Merged
jbonofre merged 1 commit intoapache:mainfrom
jbonofre:fix/log-tail-thread-leak
Apr 5, 2026
Merged

[KARAF-2513] Fix log:tail thread leak on SSH disconnect#2514
jbonofre merged 1 commit intoapache:mainfrom
jbonofre:fix/log-tail-thread-leak

Conversation

@jbonofre
Copy link
Copy Markdown
Member

@jbonofre jbonofre commented Apr 5, 2026

Fix #2513

ShellCommand.destroy() was empty — when an SSH session closes or times out while log:tail is running, the command thread stays blocked on wait() indefinitely, leaking a thread on every reconnect.

Store the Karaf session and command thread as fields, and clean them up in destroy() by closing the session and interrupting the thread (mirroring what ShellFactoryImpl already does for interactive shells).

ShellCommand.destroy() was empty, so when an SSH session is closed or
times out while log:tail is running, the command thread stays blocked
on wait() indefinitely. Each reconnect leaks another thread.

Store the Karaf session and command thread as fields and clean them up
in destroy() — close the session and interrupt the thread, mirroring
what ShellFactoryImpl already does for interactive shells.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Test Results

234 files  +1  234 suites  +1   22m 54s ⏱️ + 1m 2s
918 tests +1  870 ✅ +1  48 💤 ±0  0 ❌ ±0 
922 runs  +1  874 ✅ +1  48 💤 ±0  0 ❌ ±0 

Results for commit 2bd6a15. ± Comparison against base commit 031d9a1.

♻️ This comment has been updated with latest results.

@jbonofre jbonofre merged commit ddc7815 into apache:main Apr 5, 2026
4 of 5 checks passed
@jbonofre jbonofre deleted the fix/log-tail-thread-leak branch April 5, 2026 16:17
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.

log:tail threads keep running after ssh exits

1 participant