2748109647 opened a new pull request, #961: URL: https://github.com/apache/mina-sshd/pull/961
SFTP request listeners can initialize thread-local resources in `received`, but have no matching callback on the request thread to release them. Long-lived sessions can therefore retain resources across requests. Add a default `SftpEventListener.completed` callback, invoked in a finally block on the same thread after processing, including when `received` rejects a request or request processing fails. Responses may already have been sent at that point, so an IOException or runtime failure from a completion listener is logged rather than changing the response. Existing implementations inherit a no-op method. Closes #757. Validation on Windows with JDK 21 and Maven 3.9.14: - `mvn -B -ntp -pl sshd-sftp -am -Dtest=SftpClientTest -Dsurefire.failIfNoSpecifiedTests=false -Dcheckstyle.skip=true -Dformat.formatter.action=format -Dformat.impsort.action=sort test` passed. SftpClientTest ran successfully with all three configured I/O providers, two tests per provider. The new test checks same-thread state cleanup after a successful request, a failed operation, and a request rejected by the listener. - Formatter and import sorting ran, and `git diff --check` passed. Checkstyle was skipped after an earlier run reported 59 violations in the unchanged sshd-common module. A prior import-sort check also failed on unchanged BCrypt.java. The full repository test suite was not run. AI assistance was used. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
