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

RATIS-1368 Fix server impl NPEs #470

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

softgitron
Copy link
Contributor

@softgitron softgitron commented Apr 24, 2021

What changes were proposed in this pull request?

Fix three NPE issues reported by Sonar Qube in the server impl.

  • Add default to streamEndOfRequestAsync function
  • Throw error on notifyStateMachine... funtion
  • Remove possibility for new cache entries to be null
  • Add tests for changes

Was part of the #461

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-1368

How was this patch tested?

Changes have been tested using existing test cases and two new test cases.

@softgitron softgitron changed the title Ratis 1368 Fix server impl NPEs RATIS-1368 Fix server impl NPEs May 4, 2021
@@ -1633,7 +1645,7 @@ void submitUpdateCommitEvent() {
// update the retry cache
final CacheEntry cacheEntry = retryCache.getOrCreateEntry(invocationId);
if (getInfo().isLeader()) {
Preconditions.assertTrue(cacheEntry != null && !cacheEntry.isCompletedNormally(),
Preconditions.assertTrue(!cacheEntry.isCompletedNormally(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove cacheEntry != null ?

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