Skip to content

Don't inspect error messages for "not master" or "node is recovering" #745

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

Merged
merged 3 commits into from
Mar 17, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Mar 9, 2021

@alcaeus alcaeus self-assigned this Mar 9, 2021
Copy link
Member Author

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

@bazile-clyde @samantharitter: The changes are complete, but I'm not sure about two things that I've highlighted below. I'd appreciate your opinion on how to best proceed.

@alcaeus alcaeus force-pushed the cdriver-3885 branch 3 times, most recently from 1df16ab to caf940c Compare March 11, 2021 08:19
@alcaeus alcaeus requested a review from bazile-clyde March 11, 2021 08:19
@alcaeus alcaeus marked this pull request as ready for review March 11, 2021 08:19
Copy link
Contributor

@bazile-clyde bazile-clyde left a comment

Choose a reason for hiding this comment

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

looks good. Only a few comments.

@@ -182,7 +184,8 @@ test_state_change_helper (uint32_t domain, bool expect_error)
BSON_ASSERT (expect_error == _mongoc_error_is_state_change (&error));
}

error.code = 123;
/* Fallback code that's used when no code was returned */
error.code = 17;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this MONGOC_ERROR_QUERY_FAILURE? That way it's easier to see where it came from. It'll also be easier to grep for later.

@@ -2055,8 +2055,8 @@ test_request_scan_on_error ()
NULL /* server_err */);
/* for an unknown code, the message should still be checked. */
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is stale right? Previously, we would check the error message in the default case. Now we do not and return false. If so, we can remove it.

Copy link
Contributor

@bazile-clyde bazile-clyde left a comment

Choose a reason for hiding this comment

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

LGTM!

@alcaeus alcaeus merged commit 7b143c6 into mongodb:master Mar 17, 2021
@alcaeus alcaeus deleted the cdriver-3885 branch March 17, 2021 06:57
chardan pushed a commit to chardan/mongo-c-driver that referenced this pull request Aug 26, 2021
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