Skip to content

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
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