-
Notifications
You must be signed in to change notification settings - Fork 4
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
234 fixed problems for reinit lead state #235
Conversation
.entrySet() | ||
.stream() | ||
.collect(Collectors.toMap(Map.Entry::getKey, v -> new OffsetAndMetadata(v.getValue().offset()))); | ||
.entrySet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done via pure streams. You sure this variant is more readable?
@@ -84,6 +83,8 @@ public CommittedTransactions loadCommitsAfter(long commitId) { | |||
return committed; | |||
}).join(); | |||
return committed; | |||
} catch (Exception e) { | |||
throw new RuntimeException(e); | |||
} finally { | |||
consumerKeepers.forEach(ConsumerKeeper::close); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing ConsumerKeepers in the loop is not safe as if one of them throws the rest will not be closed properly. May be add a todo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or I suggest make ConcumerKeeper implement Autocloseable and then use
org.apache.ignite.internal.util.IgniteUtils#closeQuiet(java.lang.AutoCloseable)
in the same stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will swallow all exceptions in that case. We probably should log them at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added todo and created issue(#236) for fix it
fixes #234