Skip to content

CDRIVER-4593: Handle double type connectionId #1222

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 5 commits into from
Mar 27, 2023

Conversation

kvalagonda
Copy link
Contributor

This change validates the Int32, Int64 and Double type connectionId from the hello or ismater response from mongo. We see C-Drivers(1.23.1 & 1.23.2) are fail to connect mongo because of type check failure for double type connectionId. Please refer CDRIVER-4593 for more details.

@jmikola jmikola changed the title CDRIVER-4593: Handle doulbe type connectionId CDRIVER-4593: Handle double type connectionId Mar 27, 2023
@kevinAlbs kevinAlbs self-requested a review March 27, 2023 15:19
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @kvalagonda.

@kevinAlbs kevinAlbs requested a review from eramongodb March 27, 2023 16:54
@kevinAlbs kevinAlbs merged commit e040ceb into mongodb:master Mar 27, 2023
kevinAlbs added a commit that referenced this pull request Mar 27, 2023
* CDRIVER-4593: Handle double type connectionId

* use scopes in test_server_description_connection_id

* use cleanup instead of reset

* use ASSERT_CMPINT64

* add test for double

---------

Co-authored-by: Kevin Albertson <[email protected]>
memset (&error, 0, sizeof (bson_error_t));
mongoc_server_description_handle_hello (&sd, hello, 0 /* rtt */, &error);
BSON_ASSERT (sd.type == MONGOC_SERVER_STANDALONE);
BSON_ASSERT (sd.server_connection_id == 1);
Copy link
Member

Choose a reason for hiding this comment

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

I think this should have used ASSERT_CMPINT64 since libmongoc still stores the value as an int64_t; however, it probably makes little difference in practice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. PR posted: #1223

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.

4 participants