-
Notifications
You must be signed in to change notification settings - Fork 1.1k
FTP Session not correctly closed #3090
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
Comments
Looks like you are right: https://www.journaldev.com/661/java-ftp-client-upload-example-apache-commons-net I really see there the mentioned The same is also mentioned in the So, I consider this as a bug and we'd be glad to get a fix from you: https://github.com/spring-projects/spring-integration/blob/master/CONTRIBUTING.adoc ! Thank you for bringing this up! |
Hi artembilan,
That's the behaviour expected anyway in the RFC:
But it definitely is not a clean shutdown. Also I'm not very happy with how the client forcibly ties to close the connection even though the server is trying to communicate that there's something fishy. That is though to attribute to the Apache client which I suppose just closes the socket and lets the OS deal with whatever related packet comes from the other party. I'll have to see if I get some time to contribute a solution. The solution may be trivial as I suggested but the question is (as always) how to test it. Is there any suggestion on how to get this covered besides adjusting the existing tests (which I didn't give a look yet) ? |
Yeah... I would say let's proceed with the solution and see if all our existing tests are passing! So, let's proceed just with the code change and manual testing! Hope your environment can prove the main argument of this issue. Thanks |
I tend to disagree a bit on this point. If I had to implement this at work, I would try to find a mock FTP server that allows me to make assertions about the workflow and simulate various scenarios. Again I didn't look at the existing tests but I really don't have time right now to dig into this as at work is not a critical issue. I may spend some of my private time on this but that may happen in weeks, rather than days. |
Well, we use Apache Mina FtpServer for testing in the unit tests of the project. There is an But since you can't make a fix in time for next Monday release, we take care of this ourselves. Even if you can't make PR right now, your comments on this are fully enough to treat as a contribution. We really respect your working time and appreciate any feedback whenever it happens. Thank you again! |
Fixes spring-projects#3090 Without `logout()` the FTP session is not closed at all, but just the connection is closed. Some FTP servers close those sessions eventually anyway, but some just leak with resources. **Cherry-pick to 5.1.x & 4.3.x**
* GH-3090: Add `logout() to `FtpSession.close()` Fixes #3090 Without `logout()` the FTP session is not closed at all, but just the connection is closed. Some FTP servers close those sessions eventually anyway, but some just leak with resources. **Cherry-pick to 5.1.x & 4.3.x** * * Migrate `SessionFactoryTests` to JUnit 5
Fixes #3090 Without `logout()` the FTP session is not closed at all, but just the connection is closed. Some FTP servers close those sessions eventually anyway, but some just leak with resources. **Cherry-pick to 5.1.x & 4.3.x**
Fixes #3090 Without `logout()` the FTP session is not closed at all, but just the connection is closed. Some FTP servers close those sessions eventually anyway, but some just leak with resources. **Cherry-pick to 5.1.x & 4.3.x**
Affects Version(s): \ 4.3.20-RELEASE
Hi, we're using spring-integration for uploading FTP files to a server of ours.
Due to some unrelated problem we took a TCP dump on the FTP traffic and we could identify an issue in spring-integration which I'd like to report here.
Basically the FTP session is not closed at all but just the connection is closed. See
spring-integration/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java
Line 146 in 3cd751a
This causes the following interaction

I would suggest to add method call logout() in the Session's close() implementation.
The text was updated successfully, but these errors were encountered: