-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue 4109: Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet #4110
Merged
zymap
merged 3 commits into
apache:master
from
AnonHxy:fix_testHandleFailureBookieNotInWriteSet
Dec 4, 2023
Merged
issue 4109: Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet #4110
zymap
merged 3 commits into
apache:master
from
AnonHxy:fix_testHandleFailureBookieNotInWriteSet
Dec 4, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hangc0276
approved these changes
Oct 26, 2023
Nice catch! |
zymap
approved these changes
Dec 4, 2023
yangl
pushed a commit
to yangl/bookkeeper
that referenced
this pull request
Dec 11, 2023
…eNotInWriteSet (apache#4110) Master Issue: apache#4109 ### Motivation Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet When we call `b1Delay.completeExceptionally(new BKException.BKWriteException())` at line480(code1), the `preWriteHook` will complete with exception and then do some actions in the choosen thread(code2), e.g., put the failure bookie to `delayedWriteFailedBookies`(code3). So the `delayedWriteFailedBookies` update is async. However, `lh.appendAsync("entry2".getBytes()))`(Line483 in Code4) is invoked in main thread. So when `appendAsync` execute, the `delayedWriteFailedBookies` could be not updated yet, and `changeInProgress.complete(null)`(code5) will never be invoked.
hangc0276
pushed a commit
to hangc0276/bookkeeper
that referenced
this pull request
Jan 18, 2024
…eNotInWriteSet (apache#4110) Master Issue: apache#4109 ### Motivation Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet When we call `b1Delay.completeExceptionally(new BKException.BKWriteException())` at line480(code1), the `preWriteHook` will complete with exception and then do some actions in the choosen thread(code2), e.g., put the failure bookie to `delayedWriteFailedBookies`(code3). So the `delayedWriteFailedBookies` update is async. However, `lh.appendAsync("entry2".getBytes()))`(Line483 in Code4) is invoked in main thread. So when `appendAsync` execute, the `delayedWriteFailedBookies` could be not updated yet, and `changeInProgress.complete(null)`(code5) will never be invoked. (cherry picked from commit b3662b7)
Ghatage
pushed a commit
to sijie/bookkeeper
that referenced
this pull request
Jul 12, 2024
…eNotInWriteSet (apache#4110) Master Issue: apache#4109 ### Motivation Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet When we call `b1Delay.completeExceptionally(new BKException.BKWriteException())` at line480(code1), the `preWriteHook` will complete with exception and then do some actions in the choosen thread(code2), e.g., put the failure bookie to `delayedWriteFailedBookies`(code3). So the `delayedWriteFailedBookies` update is async. However, `lh.appendAsync("entry2".getBytes()))`(Line483 in Code4) is invoked in main thread. So when `appendAsync` execute, the `delayedWriteFailedBookies` could be not updated yet, and `changeInProgress.complete(null)`(code5) will never be invoked.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Descriptions of the changes in this PR:
Master Issue: #4109
Motivation
Fix Flaky-test: HandleFailuresTest.testHandleFailureBookieNotInWriteSet
When we call
b1Delay.completeExceptionally(new BKException.BKWriteException())
at line480(code1), thepreWriteHook
will complete with exception and then do some actions in the choosen thread(code2), e.g., put the failure bookie todelayedWriteFailedBookies
(code3). So thedelayedWriteFailedBookies
update is async.However,
lh.appendAsync("entry2".getBytes()))
(Line483 in Code4) is invoked in main thread. So whenappendAsync
execute, thedelayedWriteFailedBookies
could be not updated yet, andchangeInProgress.complete(null)
(code5) will never be invoked.We can reproduce this flasy-test if we put
Thread.sleep(5000)
just before line289 at code6.code1:
bookkeeper/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java
Line 480 in 907c273
code2:
bookkeeper/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/MockBookieClient.java
Lines 179 to 186 in 907c273
code3:
bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
Lines 1848 to 1852 in 907c273
code4:
bookkeeper/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java
Lines 480 to 483 in 907c273
code5:
bookkeeper/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/HandleFailuresTest.java
Lines 469 to 472 in 907c273
code6:
bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java
Lines 282 to 290 in 907c273
Changes
(Describe: what changes you have made)