[CDRIVER-3224] mongoc_client_session_start_transaction should error if server selection fails Created: 08/Jul/19  Updated: 28/Oct/23  Resolved: 31/Jul/19

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.15.0

Type: Improvement Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Clyde Bazile III (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3067 Ensure 4.0 drivers return an error wh... Closed
is related to CDRIVER-3161 Prohibit starting a transaction for m... Closed

 Description   

Server selection was introduced into mongoc_client_session_start_transaction for CDRIVER-3067 and CDRIVER-3161; however, neither patch considered the case where server selection might fail. If so, it looks like we'd attempt to access the property of a null pointer.

I propose adding a check and returning an error if a primary (or mongos node) could not be selected.



 Comments   
Comment by Githook User [ 31/Jul/19 ]

Author:

{'name': 'clyde', 'username': 'bazile-clyde', 'email': 'bazileclyde@gmail.com'}

Message: CDRIVER-3224 starting a transaction should error if server selection fails
Branch: cdriver-2873
https://github.com/mongodb/mongo-c-driver/commit/711c3551777fd95e236c9ce41839e92d73293c58

Comment by Githook User [ 29/Jul/19 ]

Author:

{'name': 'clyde', 'email': 'bazileclyde@gmail.com', 'username': 'bazile-clyde'}

Message: CDRIVER-3224 starting a transaction should error if server selection fails
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/711c3551777fd95e236c9ce41839e92d73293c58

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