[SERVER-22950] mongos shutdown is non-deterministic when the shutdown command is executed Created: 03/Mar/16  Updated: 21/Nov/16  Resolved: 04/Mar/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.2.5, 3.3.3

Type: Bug Priority: Major - P3
Reporter: Adam Midvidy Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: code-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-23125 Ownership semantics of MessageHandler... Closed
is related to SERVER-24600 Mongos stalls during shutdown on Windows Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Integration 11 (03/14/16)
Participants:
Linked BF Score: 0

 Description   

Once we signalShutdown() in exitCleanly, we're in a race to shutdown between the main thread (which will return from mongoSMain and call quickExit) and the thread handling the connection, which will join all the task executor threads and then call dbExit(). Depending on which thread wins, we get different logging output, since dbExit logs the process' exit code before returning. This is causing exit_logging.js to be flaky.



 Comments   
Comment by Githook User [ 10/Mar/16 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-22950 make mongos shutdown always go through exitCleanly
Branch: v3.2
https://github.com/mongodb/mongo/commit/ab18594bc8da0d14df9e7f6df91cb0ec766ed94e

Comment by Adam Midvidy [ 09/Mar/16 ]

ramon.fernandez is this cool to backport to 3.2?

Comment by Kyle Erf [ 09/Mar/16 ]

definitely needs a backport—another failure this afternoon: https://evergreen.mongodb.com/task/mongodb_mongo_v3.2_amazon_noPassthrough_f313d9f91a28661b0a7fc18eb6216596ce0051fb_16_03_09_17_34_04

Comment by Adam Midvidy [ 09/Mar/16 ]

requesting backport as this is still happening on the 3.2 branch.

Comment by Githook User [ 04/Mar/16 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-22950 make mongos shutdown always go through exitCleanly
Branch: master
https://github.com/mongodb/mongo/commit/8dd3f43ef314c25efbec3003046c0d93d6e9075b

Comment by Andy Schwerin [ 03/Mar/16 ]

Per offline conversation, I think mongos should probably be calling exitCleanly at the end of main. That would cause it to block and allow the original caller of exitCleanly to finish.

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