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

GH-8708: Fix concurrency around SFTP client #8709

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

artembilan
Copy link
Member

Fixes #8708

According to the org.apache.sshd.common.channel.ChannelAsyncOutputStream.writeBuffer() JavaDocs cannot be used concurrently.

  • Introduce internal DefaultSftpSessionFactory.ConcurrentSftpClient extension of the DefaultSftpClient to set a Lock around super.send(cmd, buffer);
  • Remove lock from the SftpSession since it now is managed by the mentioned ConcurrentSftpClient

Cherry-pick to 6.1.x & 6.0.x

Fixes spring-projects#8708

According to the `org.apache.sshd.common.channel.ChannelAsyncOutputStream.writeBuffer()` JavaDocs cannot be used concurrently.

* Introduce internal `DefaultSftpSessionFactory.ConcurrentSftpClient` extension
of the `DefaultSftpClient` to set a `Lock` around `super.send(cmd, buffer);`
* Remove lock from the `SftpSession` since it now is managed by the mentioned `ConcurrentSftpClient`

**Cherry-pick to `6.1.x` & `6.0.x`**
@artembilan artembilan requested a review from garyrussell August 22, 2023 16:34
@garyrussell garyrussell merged commit e4bacc3 into spring-projects:main Aug 22, 2023
@garyrussell
Copy link
Contributor

Cherry pick has conflicts due to sync changes; please back port.

artembilan added a commit that referenced this pull request Aug 22, 2023
Fixes #8708

According to the `org.apache.sshd.common.channel.ChannelAsyncOutputStream.writeBuffer()` JavaDocs cannot be used concurrently.

* Introduce internal `DefaultSftpSessionFactory.ConcurrentSftpClient` extension
of the `DefaultSftpClient` to set a `Lock` around `super.send(cmd, buffer);`
* Remove lock from the `SftpSession` since it now is managed by the mentioned `ConcurrentSftpClient`

**Cherry-pick to `6.1.x` & `6.0.x`**
# Conflicts:
#	spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java
artembilan added a commit that referenced this pull request Aug 22, 2023
Fixes #8708

According to the `org.apache.sshd.common.channel.ChannelAsyncOutputStream.writeBuffer()` JavaDocs cannot be used concurrently.

* Introduce internal `DefaultSftpSessionFactory.ConcurrentSftpClient` extension
of the `DefaultSftpClient` to set a `Lock` around `super.send(cmd, buffer);`
* Remove lock from the `SftpSession` since it now is managed by the mentioned `ConcurrentSftpClient`

**Cherry-pick to `6.1.x` & `6.0.x`**
# Conflicts:
#	spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java
@artembilan
Copy link
Member Author

... and cherry-picked to 6.1.x & 6.0.x after fixing conflicts.

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