Repository navigation
YARN-11999. Fix race when checking application log directory deletion in TestLogAggregationService. - #8776
Conversation
|
💔 -1 overall
This message was automatically generated. |
… in TestLogAggregationService.
|
🎊 +1 overall
This message was automatically generated. |
joseluisll
left a comment
There was a problem hiding this comment.
I had the same fix in #8717 (HADOOP-19979), so happy to see it land here instead.
One suggestion: once we wait for app1LogDir, the per-file waits are redundant. The uploaded files and the app log dir are removed by two independent FileDeletionTasks (AppLogAggregatorImpl L377 and L599). Both run on the DeletionService pool, which has more than one thread and no ordering between tasks, so either can finish first. The dir deletion is recursive, so the dir being gone means the files are gone too. A single wait covers both. With the message overload, a timeout still reports which directory was left behind:
// The uploaded files and the app log dir are removed by two independent
// FileDeletionTasks on the DeletionService pool, with no ordering between
// them. The dir deletion is recursive, so waiting for app1LogDir covers
// the files inside it.
GenericTestUtils.waitFor(() -> !app1LogDir.exists(), 1000, 1000 * 50,
"Directory [" + app1LogDir + "] was not deleted");
This also drops the assertFalse calls after each waitFor. Those can never fail, because waitFor already throws TimeoutException when the condition isn't met.
… in TestLogAggregationService.
|
🎊 +1 overall
This message was automatically generated. |
|
@joseluisll @zhtttylz Thank you very much for helping to review the code! |
Description of PR
JIRA: https://issues.apache.org/jira/browse/YARN-11999
TestLogAggregationService.verifyLocalFileDeletion()waits for individual log files to disappear, then immediately asserts that the application log directory has also been deleted.However,
DeletionServiceperforms deletion asynchronously. The individual files can disappear before the application directory deletion completes, causingtestLocalFileDeletionAfterUploadto fail intermittently.Add a bounded wait for the application log directory to disappear before asserting its deletion, using the same polling interval and timeout as the existing file-deletion checks.
This changes only test synchronization. Production behavior remains unchanged, and a persistent deletion failure still fails the test.
How was this patch tested?
CI
For code changes:
declared according to the connector-specific documentation? Note: Automated CI
testing doesn't cover all cases so manual testing with cloud storage is still
required.
LICENSE,LICENSE-binary,NOTICE-binaryfiles?AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html