[SERVER-19046] myTerminate terminate handler self deadlocks when re-entered Created: 19/Jun/15  Updated: 25/Jan/17  Resolved: 22/Jun/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.1.5

Type: Bug Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: UT
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 5 06/26/16
Participants:

 Description   

If terminate is called from within the terminate handler, as can happen in some runtimes when trying to deduce the runtime type of an active exception within myTerminate, the re-entered invocation of myTerminate deadlocks on the streamMutex.

The fix is to make myTerminate immediately call quickExit when it is re-entered in the same thread. We want to keep the existing behavior that other threads simultaneously entering myTerminate block indefinitely on the stream mutex, so that the first caller of terminate gets ample time to write messages to the logs.



 Comments   
Comment by Githook User [ 22/Jun/15 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-19046 Make myTerminate call quickExit when re-entered by a single thread.
Branch: master
https://github.com/mongodb/mongo/commit/65ba4d4d7ebd027141cb96f3252a2271b37b7705

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