Is SSH.Net safe for 2 competitive cross process (not threads) concurrent access.
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
Issue case:
- upload 2 or more files to SFTP (e.g. file-1.txt & file-2.txt)
- try to rename them simultaneously to the same name (e.g. file-3.txt) -- SftpClient.RenameFile
- renaming should be done from different processes (e.g. from 2 different K8S pods)
Result:
- expectation—there should be error, - like 'the file with the same name already exist' for some of pods (the last one)
- actual result - time to time, both file successfully renamed in sequence, and the first file will override by last one
I believe that the root cause is that ssh.net is leveraging 'AutoResetEvent' for synchronization base on source code.
But, as I know AutoResetEvent cannot be used for interprocess synchronization
The question:
Am I right with my clue, or I'm just using ssh.net not in the right way ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SftpClient.RenameFile and the SSH.NET source that uses AutoResetEvent. Reproduce concurrent renames from separate processes or Kubernetes pods, then determine whether the observed overwrite behavior is expected and document or address it with a clear result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100