mirror of
https://github.com/apache/nifi.git
synced 2025-02-07 10:38:33 +00:00
NIFI-11472 Check working directory after making directory in PutFTP
- Multiple threads can attempt to create a remote directory when PutFTP has multiple concurrent tasks. This closes #7184 Signed-off-by: David Handermann <exceptionfactory@apache.org> (cherry picked from commit d3f2bf1c16346d0fb0b56eb228a723b7b32afa65)
This commit is contained in:
parent
ae02811236
commit
07e6df896e
@ -395,7 +395,7 @@ public class FTPTransfer implements FileTransfer {
|
|||||||
if (!cdSuccessful) {
|
if (!cdSuccessful) {
|
||||||
if (client.makeDirectory(remoteDirectory)) {
|
if (client.makeDirectory(remoteDirectory)) {
|
||||||
logger.debug("Remote Directory not found: created directory [{}]", remoteDirectory);
|
logger.debug("Remote Directory not found: created directory [{}]", remoteDirectory);
|
||||||
} else {
|
} else if (!setWorkingDirectory(remoteDirectory)) { // Double check that the dir exists as it might have been created in another thread
|
||||||
throw new IOException("Failed to create remote directory " + remoteDirectory);
|
throw new IOException("Failed to create remote directory " + remoteDirectory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user