...
BugZero found this defect 2710 days ago.
[SERVER-30260] Fix race condition in ServiceEntryPointImpl endAllSessions
xgen-internal-githook commented on Fri, 28 Jul 2017 15:00:54 +0000: 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 jonathan.reams@10gen.com commented on Fri, 21 Jul 2017 17:04:20 +0000: 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. charlie.swanson commented on Fri, 21 Jul 2017 17:03:19 +0000: Gotcha, thanks! So this should only ever happen on ASAN, and result in a server crash with a segfault? jonathan.reams@10gen.com commented on Fri, 21 Jul 2017 17:01:19 +0000: 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. charlie.swanson commented on Fri, 21 Jul 2017 16:25:34 +0000: 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.