[CDRIVER-798] Async scan spins for 30 seconds after server hangup Created: 11/Aug/15  Updated: 19/Oct/16  Resolved: 01/Sep/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.2-beta0
Fix Version/s: 1.2-beta1

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Even with serverSelectionTryOnce true, if the server hangs up on an "ismaster" call, mongoc_async_run spins serverSelectionTimeoutMS (default 30 seconds) before giving up and returning to mongoc_topology_select.

When mongoc_stream_read returns 0 it means the server has shut down the connection, but the 0 return is not properly handled so the async_cmd_t remains in the "receiving" phase. The socket appears readable so mongoc_async_run doesn't block on "poll", hence the 100% CPU spin until the timeout.



 Comments   
Comment by Githook User [ 11/Jan/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-798 async_cmd checks for closed socket

Detects when server closes the connection on a call to ismaster.
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/31ea0e6b0d278fbc24237cf31d906ef5aba7361a

Comment by Githook User [ 01/Sep/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-798 async_cmd checks for closed socket

Detects when server closes the connection on a call to ismaster.
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/31ea0e6b0d278fbc24237cf31d906ef5aba7361a

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