Russole commented on code in PR #11989:
URL: https://github.com/apache/ozone/pull/11989#discussion_r4572198391


##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestExportJobManager.java:
##########
@@ -283,6 +283,30 @@ void getQueuePositionAssignsSequentialPositions() throws 
Exception {
     }
   }
 
+  @Test
+  void jobDirectoryCreationFailureFreesQueueSlot() throws Exception {
+    // A regular file in place of the export directory makes the worker fail
+    // while creating the job directory, before any export work starts. With
+    // the smallest queue (1) a leaked slot would reject the very next submit.
+    manager.shutdown();
+    Path exportDir = tempDir.resolve("exports");
+    Files.createFile(exportDir);
+    manager = newManager(/* maxQueueSize */ 1, exportDir);
+    stubExport(STATE_MISSING, 1);
+
+    String failedJobId = manager.submitJob(STATE_MISSING);
+    awaitStatus(failedJobId, JobStatus.FAILED, DEFAULT_AWAIT);
+    
assertThat(manager.getJob(failedJobId).getErrorMessage()).contains(exportDir.toString());

Review Comment:
   nit: Could we wait for the error message too? The worker sets `FAILED` 
before writing it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to