@@ -1190,25 +1190,16 @@ String getExecutionSpecificTmpDir() {
11901190 String baseTmpDir = AnsibleUtil .getCustomTmpPathDir (framework );
11911191
11921192 if (executionId != null && !executionId .isEmpty ()) {
1193- java .nio .file .Path basePath = Paths .get (baseTmpDir );
1194- try {
1195- // createDirectories is idempotent: safe under concurrent invocations.
1196- Files .createDirectories (basePath );
1197- } catch (IOException e ) {
1198- String errorMsg = "Failed to ensure base tmp directory exists: " + basePath ;
1199- log .error (errorMsg , e );
1200- throw new IllegalStateException (errorMsg , e );
1201- }
1202-
1203- // Atomic + unique by construction; the executionId prefix lets operators filter all
1204- // directories belonging to a given Rundeck execution with a single glob.
1193+ // Atomic + unique by construction. No coordination needed between sibling threads
1194+ // sharing the same Rundeck executionId. The executionId prefix lets operators filter
1195+ // all directories belonging to a given Rundeck execution with a single glob.
12051196 try {
12061197 executionSpecificDir = Files
1207- .createTempDirectory (basePath , "ansible-exec-" + executionId + "-builder-" )
1198+ .createTempDirectory (Paths . get ( baseTmpDir ) , "ansible-exec-" + executionId + "-builder-" )
12081199 .toFile ();
12091200 log .debug ("Created builder-specific directory: {}" , executionSpecificDir .getAbsolutePath ());
12101201 } catch (IOException e ) {
1211- String errorMsg = "Failed to create builder-specific directory under: " + basePath ;
1202+ String errorMsg = "Failed to create builder-specific directory under: " + baseTmpDir ;
12121203 log .error (errorMsg , e );
12131204 throw new IllegalStateException (errorMsg , e );
12141205 }
0 commit comments