Skip to content

[KARAF-2513] Fix log:tail thread leak on SSH disconnect (backport to 4.4.x)#2519

Open
jbonofre wants to merge 1 commit intoapache:karaf-4.4.xfrom
jbonofre:backport-2514-karaf-4.4.x
Open

[KARAF-2513] Fix log:tail thread leak on SSH disconnect (backport to 4.4.x)#2519
jbonofre wants to merge 1 commit intoapache:karaf-4.4.xfrom
jbonofre:backport-2514-karaf-4.4.x

Conversation

@jbonofre
Copy link
Copy Markdown
Member

@jbonofre jbonofre commented Apr 5, 2026

Summary

Backport of #2514 to karaf-4.4.x.

  • Fix ShellCommand.destroy() which 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)

Fix #2513

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

243 files  +1  243 suites  +1   29m 7s ⏱️ + 1m 46s
994 tests +1  951 ✅ +1  43 💤 ±0  0 ❌ ±0 
998 runs  +1  955 ✅ +1  43 💤 ±0  0 ❌ ±0 

Results for commit 9bdc11a. ± Comparison against base commit 1c806ee.

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.

1 participant