[CDRIVER-4502] libmongoc expects connectionId in hello response to be int32 Created: 13/Oct/22  Updated: 28/Oct/23  Resolved: 17/Oct/22

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.22.0
Fix Version/s: 1.22.2, 1.23.1

Type: Bug Priority: Blocker - P1
Reporter: Andreas Braun Assignee: Andreas Braun
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPLIB-1023 Atlas Data Lake tests fail due to lib... Closed
Related
related to CDRIVER-4593 C Driver fails to validate double typ... Closed
related to DRIVERS-2503 ConnectionId returned in heartbeats m... Implementing
related to PHPC-2157 Upgrade libmongoc to 1.22.2 Closed
related to CDRIVER-4557 ConnectionId returned in heartbeats m... Closed
is related to CDRIVER-4499 mongoc_server_description_handle_hell... Closed
is related to CDRIVER-4085 Add server connectionId to command mo... Closed

 Description   

This is the root cause for the issue identified in CDRIVER-4499. mongoc_server_description_handle_hello checks the type for the connectionId field and fails if it's not an int64. Despite the command monitoring spec specifying the field as int32, both the server's IDL for hello and mongohoused's response declare the field as int64. While this number is unlikely to exceed the 32-bit range, mongohoused always returns an int64 even when the number would fit in an int32. Given this, libmongoc should accept both int32 and int64 responses, while also ensuring that 64-bit values are handled accordingly (either by failing with an error message or by truncating the connection id so it fits in an int32.

This was introduced by CDRIVER-4085 in 1.22.0, so a backport to 1.22 would be much appreciated.



 Comments   
Comment by Githook User [ 17/Oct/22 ]

Author:

{'name': 'Andreas Braun', 'email': 'alcaeus@users.noreply.github.com', 'username': 'alcaeus'}

Message: CDRIVER-4502: Handle int64 connectionId values in hello responses (#1121)
Branch: r1.23
https://github.com/mongodb/mongo-c-driver/commit/609700d2cfda6878424550fef09e14a38b0d17f1

Comment by Githook User [ 17/Oct/22 ]

Author:

{'name': 'Andreas Braun', 'email': 'alcaeus@users.noreply.github.com', 'username': 'alcaeus'}

Message: CDRIVER-4502: Handle int64 connectionId values in hello responses (#1121)
Branch: r1.22
https://github.com/mongodb/mongo-c-driver/commit/c9e0679f82977b6326a85509af3d882d8135daf6

Comment by Githook User [ 17/Oct/22 ]

Author:

{'name': 'Andreas Braun', 'email': 'alcaeus@users.noreply.github.com', 'username': 'alcaeus'}

Message: CDRIVER-4502: Handle int64 connectionId values in hello responses (#1121)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5450450067e0c2bd031cd2736992f9f404aa99ee

Comment by Andreas Braun [ 14/Oct/22 ]

https://github.com/mongodb/mongo-c-driver/pull/1121

Generated at Wed Feb 07 21:21:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.