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

FTP locks file if server not available [INT-3537] #7500

Closed
spring-operator opened this issue Oct 21, 2014 · 3 comments
Closed

FTP locks file if server not available [INT-3537] #7500

spring-operator opened this issue Oct 21, 2014 · 3 comments

Comments

@spring-operator
Copy link
Contributor

Tim McAuley opened INT-3537 and commented

When trying to upload a file to an FTP / SFTP server, if the server is not available, the file remains locked. This blocks the rename / deletion of the file in post-processing.

Looking in RemoteFileTemplate, within the integration-file jar, it seems that inputStreamHolder is not closed if the FTP session could not be created. It will be closed successfully if there is an error once the session has been created ok; such as incorrect remote folder but not if the error occurs during session creation.

The code in question where the stream is opened:

public String send(final Message<?> message, final String subDirectory) {
		Assert.notNull(this.directoryExpressionProcessor, "'remoteDirectoryExpression' is required");
		final StreamHolder inputStreamHolder = this.payloadToInputStream(message);
		if (inputStreamHolder != null) {
			return this.execute(new SessionCallback<F, String>() {
...

Looking at the github master branch, this problem probably still exists in 4.1.


Affects: 4.0.4

Referenced from: pull request #1300

Backported to: 3.0.6

@spring-operator
Copy link
Contributor Author

Gary Russell commented

Artem Bilan Please test on Windows before merging; the rename does not fail on Mac/Linux.

Cherry-pick to 4.0.x, 3.0.x.

@spring-operator
Copy link
Contributor Author

Tim McAuley commented

Guys! Great job.

I've just tried the snapshot of 4.0.5 and it worked perfectly.

Thanks for such a fast response.

@spring-operator
Copy link
Contributor Author

Artem Bilan commented

You are welcome!

And thank you for such a feedback and reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants