Skip to content
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

Add Thread naming based on remote socket address #753

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

exceptionfactory
Copy link
Contributor

This pull requests adds standard Thread names for the Transport Reader, the SFTP PacketReader, and the Connection KeepAlive Threads. The implementation includes a ThreadNameProvider class to set the Thread name prefixed with sshj followed by the simple class name and the remote socket address. The following provides an example name for the Transport Reader Thread:

sshj-Reader-localhost/127.0.0.1:22

This approach to thread naming provides association with SSHJ, identification of the Thread implementation, and the ability to distinguish between connections to different endpoints. These changes address the troubleshooting challenges described in issue #738.

- Added ThreadNameProvider to set name based on Thread Class and remote socket address
- Added RemoteAddressProvider to abstract access to Remote Socket Address
- Set Reader Thread name in TransportImpl
- Set SFTP PacketReader Thread name in SFTPEngine
- Set KeepAlive Thread name in SSHClient
@exceptionfactory
Copy link
Contributor Author

Rebased

@hierynomus hierynomus merged commit cab7731 into hierynomus:master Dec 23, 2021
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.

None yet

2 participants