[SERVER-79] global 'ports' variable is not used in a thread safe manner Created: 29/May/09  Updated: 12/Jul/16  Resolved: 01/Jun/09

Status: Closed
Project: Core Server
Component/s: Stability
Affects Version/s: None
Fix Version/s: 0.9.4

Type: Bug Priority: Minor - P4
Reporter: Aaron Staple Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Whenever we create a new MessagingPort, its address gets added to a global ports object. We may create MessagingPort objects in Listener::listen() or in DBClientConnection::connect(), and the db mutex need not be held in either context. It looks like the MessagingPort objects created by Listener are never destroyed, but the ones created by DBClientConnection get destroyed when the connection is destroyed. On destruction MessagingPort objects are removed from the 'ports' set, and this isn't done in a thread safe manner either.

Resulted in a seg fault here:
<http://buildbot.mongodb.org/builders/OS%20X%2010.5%2032-bit/builds/372/steps/test_3/logs/stdio>



 Comments   
Comment by Aaron Staple [ 29/May/09 ]

Do you want Eliot to fix this by adding a new mutex to protect the global 'ports' object?

Comment by Aaron Staple [ 29/May/09 ]

Do you want me to fix this by adding a new mutex to protect the global 'ports' object?

Generated at Thu Feb 08 02:52:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.