[CXX-2705] Driver calls 'abort()' when internet is disconnected and crashes app Created: 27/Jun/23  Updated: 28/Oct/23  Resolved: 14/Jul/23

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.9.0

Type: Bug Priority: Unknown
Reporter: jeff strom Assignee: Josh Siegel (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File cxx_null_pool.png    

 Description   

Summary

After starting my app with my internet connection disconnected, instancing the 'mongocxx::pool' object with a valid connection string and calling 'mongocxx::Pool::acquire()' or  'mongocxx::Pool::try_acquire()' crash the app due to an error thrown inside of the mongoc drvier with message 'mongoc-client-pool.c:346 mongoc_client_pool_try_pop(): precondition failed: pool'

Environment

mongocxx lib version 3.7.0

OS: Windows 10 Home 64-bit

Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32216.1 for x86

How to Reproduce
Disconnect computer from internet
Compile and run the following C++ with MSVC:
        auto inst = mongocxx::instance();
        std::string connStr = "<valid connection string for mdb here>";
        auto pool = std::make_shared<mongocxx::pool>(mongocxx::uri{ connStr });_
        auto pl = pool->try_acquire();_
The driver should abort with message 'mongocxx::Pool::try_acquire()' crash the app due to an error thrown inside of the mongoc drvier with message 'mongoc-client-pool.c:346 mongoc_client_pool_try_pop(): precondition failed: pool'



 Comments   
Comment by Githook User [ 14/Jul/23 ]

Author:

{'name': 'Joshua Siegel', 'email': '39130209+joshbsiegel@users.noreply.github.com', 'username': 'joshbsiegel'}

Message: CXX-2705 throw an exception upon unsuccessful pool creation (#987)
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/a4d9067cdda62e1345fe2ebd1e531760939488da

Comment by PM Bot [ 27/Jun/23 ]

Hi jeff@pulsemedica.com, thank you for reporting this issue! The team will look into it and get back to you soon.

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