mirror of https://github.com/apache/nifi.git
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>
This commit is contained in:
parent
1fa5da9a55
commit
d3f2bf1c16
|
@ -395,7 +395,7 @@ public class FTPTransfer implements FileTransfer {
|
|||
if (!cdSuccessful) {
|
||||
if (client.makeDirectory(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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue