jenkinsci / jenkinsci/ec2-plugin

SMBJ PacketReader thread leak in DirectTcpTransport

Open
#1,992 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
292
Forks
709
Avg merge
3d 16h
Merged PRs (30d)
4

Description

The plugin leaks SMBJ PacketReader threads when Windows agent connections close unexpectedly (EC2 termination, network failures, timeouts).

The root cause looks like a bug in SMBJ library, just reported at https://github.com/hierynomus/smbj/issues/882 but there are concerns about the project's maintenance:

  • Last release: v0.14.0 (2024-12-09)
  • Some PRs merged in early 2025 but not released
  • Multiple 2025 issues without response (some question project is still alive)

We could consider pushing/contributing for a new release that includes a fix, or, if no other options, explore an ugly reflection-based workaround to access the thread and call stop, though this approach is admittedly a workaround.

If anyone has more experience with this SMB lib, your advice or input would be much appreciated before I continue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DirectTcpTransport and review SMBJ issue #882 alongside the connection-close paths for EC2 termination, network failures, and timeouts. Reproduce an unexpected Windows agent disconnect and verify that PacketReader threads no longer leak; the issue does not name a test or a settled implementation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
cloud, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.