Closed jnth closed 2 years ago
Response from mbrubeck in Rust community forum:
I suspect you have found a bug in the
async_ssh2_lite
crate.I notice that its dependency ssh2 uses blocking mutexes throughout its SFTP implementation. Perhaps this is causing deadlocks if a lock is held across an await point in an async function. It makes sense that you could work around this bug by creating a separate session for each file, since the lock is per-session.
There is also a known bug #10 that can cause deadlocks, but I don't know if this one is relevant to your use case.
Hey guys,
I'm using the above code posted by the original author to upload a file using sftp. When the process tries to upload a file that is over 300kb it just hangs for about 5 minutes. I then get a result = [Ok(())] in the console. But the file on ftp has a size of 0 bytes. Does anyone have any ideas why this could be?
Thanks in advance.
Please retry with v0.3.0
Hello,
Following the post I send in Rust community forum, I open an issue.
I got a strange behaviour when I send files in a SFTP server in async mode: sometimes, one or more files sent are not wrote.
This is my
Cargo.toml
:This is my simple SFTP client in Rust:
Inside
~/tmp/to_inject
:I run
cargo run -- -h 127.0.0.1:3373 ~/tmp/to_inject/*
:At the destination folder, sometimes (nearly 1 time over 5), not all files are present:
This is the log of the Python
sftpserver
but I got the same behaviour with SSHd:In this log, we can see 5 open, write and close.
The log of
pyinotify
in the destination folder:There's only the trace of 3 files.