Skip to content
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

Async snapshot by working thread of RAFT #309

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

yfei-z
Copy link
Contributor

@yfei-z yfei-z commented Sep 25, 2024

Fix the issue #300, and a little change related to #308, I think DownRequests should failed directly if there is no space in the processing queue, let the caller to decide to retry or not, and this also meets the expectations of #168 which DownRequests has lower priority than UpRequests. And another thing is to make setAsync uninterruptible (no blocking operation), it helps StateMachine to implement uninterruptible interface. ArrayBlockingQueue.put checks the interrupted status first, that means if the thread is interrupted before calling ArrayBlockingQueue.put then InterruptedException will be thrown even there is space available in the queue, so the outer method needs to check if there is an InterruptedException in the returned future and retry to make it uninterruptible, actually I think the IllegalStateException could be exposed directly while the processing queue is full.

@jabolina jabolina self-requested a review September 26, 2024 00:27
@jabolina jabolina added this to the 1.0.14 milestone Sep 26, 2024
Copy link
Member

@jabolina jabolina left a comment

Choose a reason for hiding this comment

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

We have the tests for snapshot passing. Just this one change and it should be good to go.

takeSnapshot(); sr.f.complete(null);
} catch (Exception e) {
sr.f.completeExceptionally(e);
throw e;
Copy link
Member

Choose a reason for hiding this comment

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

There is no need to rethrow this exception. It will run from a single thread and would discard the batch of messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in a Throwable try catch block, it can't affect other messages of the batch, and I think the exception is a internal error of the state machine it‘s worth printing out.

@jabolina
Copy link
Member

hey, @yfei-z. Sorry, can you include the 060e389 commit in another PR?

@yfei-z
Copy link
Contributor Author

yfei-z commented Oct 1, 2024

Sorry commit to a wrong branch

@jabolina jabolina merged commit 4490c3c into jgroups-extras:master Oct 2, 2024
6 checks passed
@jabolina
Copy link
Member

jabolina commented Oct 2, 2024

Thanks, @yfei-z!

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.

Taking snapshot and committing log are not atomic operations for each other
2 participants