Skip to content

GH-8708: Fix concurrency around SFTP client#8709

Merged
garyrussell merged 1 commit into
spring-projects:mainfrom
artembilan:GH-8708
Aug 22, 2023
Merged

GH-8708: Fix concurrency around SFTP client#8709
garyrussell merged 1 commit into
spring-projects:mainfrom
artembilan:GH-8708

Conversation

@artembilan
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

spring-integration-sftp: org.apache.sshd.common.io.WritePendingException: A write operation is already pending;

2 participants