[CDRIVER-3239] Driver aborts during OP_MSG bulk write if command fails mid batch Created: 15/Jul/19  Updated: 28/Oct/23  Resolved: 12/Aug/19

Status: Closed
Project: C Driver
Component/s: Bulk API, libmongoc
Affects Version/s: 1.13.1
Fix Version/s: 1.15.0

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
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 CDRIVER-3195 Driver aborts during bulk write Closed
Related
is related to CDRIVER-3305 OP_MSG unordered bulk writes should n... Closed
is related to CDRIVER-3306 Do not assume non-empty server reply ... Closed
is related to CDRIVER-3587 Do not reuse server stream that becom... Closed

 Description   

The bug report of CDRIVER-3195 appears to be due to mishandling of OP_MSG bulk writes when we fail to write to the server socket in the middle of a batch.

result->must_stop, which was introduced in CDRIVER-1556, indicates if a bulk write should stop attempting commands due to a socket disconnect. It is checked in _mongoc_write_opquery but not checked in _mongoc_write_opmsg. So we attempt the sending next OP_MSG without having a socket.

I've reproduced on 1.13.1 and master, but I suspect this goes back to our initial OP_MSG support in 1.9.



 Comments   
Comment by Githook User [ 12/Aug/19 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3239 respect must_stop in _mongoc_write_opmsg
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/e6cf2a3cecf58eb965fff394d9b2de29c7b107ba

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