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

GEODE-8457: Fix crash when IO_error and single-hop=false #642

Merged
merged 2 commits into from Aug 27, 2020

Conversation

albertogpz
Copy link
Contributor

No description provided.

LOGINFO("Removing bucketServerLocation %s due to GF_IOERR",
sl->toString().c_str());
m_clientMetadataService->removeBucketServerLocation(sl);
if (m_clientMetadataService != nullptr) {
Copy link
Member

Choose a reason for hiding this comment

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

When I see an if statement, I usually think there's a possible test case. One for when the statement is true, and one for false. Is it possible to write a test for this and the below if statements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The m_clientMetadataService member variable is null when single-hop is not enabled.
I have duplicated the test cases I created to verify the fix for GEODE-8231 which had single-hop enabled, to also test the case when single-hop is disabled.

LOGINFO("Removing bucketServerLocation %s due to GF_IOERR",
sl->toString().c_str());
m_clientMetadataService->removeBucketServerLocation(sl);
if (m_clientMetadataService != nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The one style thing I would point out is that std::unique_ptr explicitly converts to true if set or false if is nullptr specifically for the usage in if statements like this.

if (m_clientMetadataService) {
  m_clientMetadataService->doSomething();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@pdxcodemonkey pdxcodemonkey merged commit 8823005 into apache:develop Aug 27, 2020
alb3rtobr pushed a commit to Nordix/geode-native that referenced this pull request Aug 27, 2020
- Added 2 test cases and style changes after review
jvarenina pushed a commit to Nordix/geode-native that referenced this pull request Oct 28, 2020
- Added 2 test cases and style changes after review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants