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

234 fixed problems for reinit lead state #235

Merged
merged 3 commits into from
May 2, 2017
Merged

234 fixed problems for reinit lead state #235

merged 3 commits into from
May 2, 2017

Conversation

ex00
Copy link
Collaborator

@ex00 ex00 commented Apr 28, 2017

fixes #234

.entrySet()
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, v -> new OffsetAndMetadata(v.getValue().offset())));
.entrySet();
Copy link
Collaborator

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);
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Collaborator

@YevIgn YevIgn May 2, 2017

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.

Copy link
Collaborator Author

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

@ex00 ex00 merged commit 4d216b9 into develop May 2, 2017
@ex00 ex00 removed the in progress label May 2, 2017
@ex00 ex00 deleted the feature/234 branch May 2, 2017 15:23
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.

5 participants