[SERVER-2537] connTicketHolder leak in OurListener Created: 11/Feb/11  Updated: 12/Jul/16  Resolved: 31/Mar/11

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: 1.6.5
Fix Version/s: 1.9.0

Type: Bug Priority: Minor - P4
Reporter: Jernej Kos Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongodb-1.6.5-fix-connection-leak.patch    
Operating System: ALL
Participants:

 Description   

There appears to be a connection ticket leak in OurListener constructor (db.cpp) when a boost thread can't be created. The listener successfuly acquires a ticket from the TicketHolder and then relies on connThread method's TicketHolderReleaser to actually release the ticket when the thread finishes. But when the thread can't be created, the ticket is never released and a connection slot is left "used" forever. The fix should be a trivial call to connTicketHolder.release() when an exception ocurrs in OurListener constructor after the connection ticket has been acquired.



 Comments   
Comment by auto [ 31/Mar/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: make sure if we can't start a new thread for a socket, we release the connection ticket SERVER-2537
Branch: master
https://github.com/mongodb/mongo/commit/9a397af854861484ebba3cfd6bbe92f7bbe7fb62

Comment by Jernej Kos [ 17/Mar/11 ]

I am attaching a patch for version 1.6.5 that I have been using for 1 month on a production server and it completely solves the problem mentioned above.

Generated at Thu Feb 08 03:00:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.