This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.2 by this push:
new 7e4909b904f branch-4.2: [fix](fe) Wait for Hudi listing task
completion in lease test (#68578)
7e4909b904f is described below
commit 7e4909b904ff49fc799e5a4efa02f03fe4a8638d
Author: 924060929 <[email protected]>
AuthorDate: Tue Sep 29 21:38:11 2026 +0800
branch-4.2: [fix](fe) Wait for Hudi listing task completion in lease test
(#68578)
### What problem does this PR solve?
Issue Number: None
Related PR: #66913, #68572
Problem Summary: The Hudi listing cancellation test waits for a latch
signalled inside the blocked task body, then verifies that the
filesystem-view lease was closed. The task's terminal callback and owner
accounting run after that signal, so a delayed worker can make the
assertion fail even though the lease is released correctly once the task
completes. Wait for the executor to finish the task and terminal
callback before verifying the lease close. The assertion that
cancellation does not release the lease while the task remains blocked
is preserved. This is the branch-4.2 counterpart of #68572.
### Release note
None
### Check List (For Author)
- Test: Unit Test: HudiBatchFsViewOwnerTest (14 tests passed); FE
Checkstyle (0 violations)
- Behavior changed: No, test synchronization only
- Does this need documentation: No
---
.../hudi/source/HudiBatchFsViewOwnerTest.java | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/hudi/source/HudiBatchFsViewOwnerTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/hudi/source/HudiBatchFsViewOwnerTest.java
index 735ad83f3db..4c615717917 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/hudi/source/HudiBatchFsViewOwnerTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/hudi/source/HudiBatchFsViewOwnerTest.java
@@ -224,19 +224,14 @@ class HudiBatchFsViewOwnerTest {
HudiScanNode.ListingFsViewOwner owner = new
HudiScanNode.ListingFsViewOwner(lease, executor);
CountDownLatch started = new CountDownLatch(1);
CountDownLatch release = new CountDownLatch(1);
- CountDownLatch terminated = new CountDownLatch(1);
HudiScanNode.TerminalTask task = new HudiScanNode.TerminalTask(() -> {
started.countDown();
- try {
- while (release.getCount() > 0) {
- try {
- release.await(3, TimeUnit.SECONDS);
- } catch (InterruptedException ignored) {
- // Model storage code that does not terminate when
interrupted.
- }
+ while (release.getCount() > 0) {
+ try {
+ release.await(3, TimeUnit.SECONDS);
+ } catch (InterruptedException ignored) {
+ // Model storage code that does not terminate when
interrupted.
}
- } finally {
- terminated.countDown();
}
}, () -> { });
Assertions.assertTrue(owner.submit(task));
@@ -251,8 +246,9 @@ class HudiBatchFsViewOwnerTest {
waiter.get(3, TimeUnit.SECONDS);
Mockito.verify(lease, Mockito.never()).close();
release.countDown();
- Assertions.assertTrue(terminated.await(3, TimeUnit.SECONDS));
- Mockito.verify(lease, Mockito.timeout(3000)).close();
+ executor.shutdown();
+ Assertions.assertTrue(executor.awaitTermination(30,
TimeUnit.SECONDS));
+ Mockito.verify(lease).close();
} finally {
release.countDown();
executor.shutdownNow();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]