[SERVER-30260] Fix race condition in ServiceEntryPointImpl endAllSessions Created: 21/Jul/17  Updated: 30/Oct/23  Resolved: 28/Jul/17

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

Type: Bug Priority: Major - P3
Reporter: Jonathan Reams Assignee: Jonathan Reams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2017-07-31
Participants:
Linked BF Score: 0

 Comments   
Comment by Githook User [ 28/Jul/17 ]

Author:

{'email': 'jbreams@mongodb.com', 'username': 'jbreams', 'name': 'Jonathan Reams'}

Message: SERVER-30260 Fix race condition in endAllSessions
Branch: master
https://github.com/mongodb/mongo/commit/6f5f53f79552aacbbfba8c7e61cf7b15f58f3f3f

Comment by Jonathan Reams [ 21/Jul/17 ]

No, it can happen during replication stepdown or feature compatibility changes, which also call endAllSessions(). I guess I should have said endAllSessions() only gets called during shutdown if ASAN is active.

Comment by Charlie Swanson [ 21/Jul/17 ]

Gotcha, thanks! So this should only ever happen on ASAN, and result in a server crash with a segfault?

Comment by Jonathan Reams [ 21/Jul/17 ]

charlie.swanson, it doesn't look like BF-5995 is related; endAllSessions() doesn't get called during shutdown except if you're running under ASAN. The race is that the Client and transport::Session can be cleaned up while endAllSessions() is terminating connections. So the SSM that owns them is still around, but deferencing the transport::SessionHandle to check its tags for endAllSessions will crash the server with a segfault.

Comment by Charlie Swanson [ 21/Jul/17 ]

jonathan.reams can you describe the race? I'm looking at some build failures (such as BF-5995) and curious how this might impact shutdown.

Generated at Thu Feb 08 04:23:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.