Skip to content

added retry to find partition#3039

Merged
allenaverbukh merged 16 commits intomasterfrom
handlePartitionError
Mar 25, 2025
Merged

added retry to find partition#3039
allenaverbukh merged 16 commits intomasterfrom
handlePartitionError

Conversation

@allenaverbukh
Copy link
Contributor

@allenaverbukh allenaverbukh commented Mar 13, 2025

Summary

added retry to find partition to avoid exceptions

Testing Done

New UT and ensure existing UT passes

* after the associated chunk is complete, the buffer is not reused even though the PutChunk is reused.
*/
@Test
public void testRetry() throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please change the function to something like testRetryOnSimpleOperationTrackerConstructorFailure?

// Mock the behavior of getRandomWritablePartition to return different values on each call
doAnswer(invocation -> {
int callNum = callCount.getAndIncrement(); // Increment call count and get the current value
if (callNum == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if statement should be

if (callCount.getAndIncrement() == 0) {
    return mockPartitionIdFail;
} else {
    return mockPartitionIdPass;
}

@allenaverbukh allenaverbukh merged commit 8c63948 into master Mar 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants