[CDRIVER-810] mongoc_cluster_disconnect_node() doesn't disconnect it in single threaded mode Created: 19/Aug/15  Updated: 19/Oct/16  Resolved: 16/Sep/15

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

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-683 Temporary write failure does not disc... Closed
related to CDRIVER-830 Exhaust cursors must destroy the stre... Closed

 Description   

When mongoc_cluster_try_recv() fails for example with a timeout, the node is disconnected using mongoc_cluster_disconnect_node().
The mongoc_cluster_disconnect_node() is implemented :

void                                                                                     
mongoc_cluster_disconnect_node (mongoc_cluster_t *cluster, uint32_t server_id)           
{                                                                                        
   if (cluster->client->topology->single_threaded) {                                     
      return;                                                                            
   }                                                                                     
                                                                                         
   mongoc_set_rm(cluster->nodes, server_id);                                             
}                            

In the case where the caller calls mongoc_topology_invalidate_server() works out in the end, but that is not always the case (like destroying cursor in exhaust mode, or writev_full() failure)



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

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-683 & CDRIVER-810: Disconnect from a node properly

Even in single threaded mode
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/11760f87794a9e2d7e35ccb379eb1e09e9a8e700

Comment by Githook User [ 26/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-683 & CDRIVER-810: Disconnect from a node properly

Even in single threaded mode
Branch: debian
https://github.com/mongodb/mongo-c-driver/commit/11760f87794a9e2d7e35ccb379eb1e09e9a8e700

Comment by Githook User [ 16/Sep/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-683 & CDRIVER-810: Disconnect from a node properly

Even in single threaded mode
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/11760f87794a9e2d7e35ccb379eb1e09e9a8e700

Comment by A. Jesse Jiryu Davis [ 25/Aug/15 ]

Even if it does call mongoc_topology_invalidate_server, then there's no immediate call to mongoc_topology_reconcile, right? So the cluster node isn't destroyed until the next scan, I believe, which is wrong.

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