[CDRIVER-476] mongoc_collection_find does not report dropped connection Created: 03/Dec/14  Updated: 03/May/17  Resolved: 06/Jan/15

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

Type: Bug Priority: Major - P3
Reporter: Tim Dorcey Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

osx



 Description   

If client drops connection to the server, mongoc_collection_find() returns empty cursor as if no documents match the query, rather than signalling an error. Logs show "WARNING: stream: Failure to buffer 4 bytes: Failed to buffer 4 bytes within 300000 milliseconds," but this is not passed up to the application level.



 Comments   
Comment by Tim Dorcey [ 03/Dec/14 ]

My error. I was calling mongoc_cursor_error() before calling mongoc_cursor_more() && mongoc_cursor_next(). Checking for an error after trying to read the cursor does detect dropped connection. Not sure how to close this issue.

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