Thanks for the log!
According to the log, the "Resource busy. Failed to rename /IN/SINNestor/ASAA13E100.tmp to /IN/SINNestor/ASAA13E100.txt because the file is currently in progress." messages actually comes from the SFTP server which failed to rename a file.
However, the log also proves that the file was completely uploaded and the handle obtained by a
SSH_FXP_OPEN request was properly closed by a corresponding
SSH_FXP_CLOSE request. When the
SSH_FXP_RENAME request was received by the server, the SFTP client certainly was not accessing the file in any way.
Unfortunately, this means that there is not much the client can do - your code (and Rebex SFTP) doesn't do anything wrong, it's the server that is refusing the rename request for some reason... For example, it's possible that as soon as a file is completely uploaded, the server itself keeps it locked for a short time while updating its database or scanning it for malicious code. Without access to the server, we can't really tell, but it looks like some process is in fact going when the file has been uploaded.
At this point, I would recommend experimenting a bit with simple workarounds such as retrying the rename operation after a delay - to detect this kind of error, catch
SftpException and check whether its
Status property is
SftpExceptionStatus.ProtocolError and whether its
Code property is
SftpErrorCode.Failure. Please let me know whether this has any effect.