[SERVER-23293] Allow more graceful shutdown from signals Created: 22/Mar/16  Updated: 09/Oct/19  Resolved: 09/Oct/19

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

Type: New Feature Priority: Minor - P4
Reporter: Chris Harris Assignee: Mira Carey
Resolution: Duplicate Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-38994 Step down on SIGTERM Closed
Related
Participants:
Case:

 Description   

Currently, all caught signals (with the exception of SIGUSR1) result in the mongod process shutting down cleanly, but without considering replication status as done via the shutdown command. It would be helpful if one of the signals could indicate a desire to attempt the full shutdown process (even if it cannot complete due secondaries not being caught up).



 Comments   
Comment by Andy Schwerin [ 23/Mar/16 ]

It seems that some replication-specific code is present in the CmdShutdownMongoD::run, which runs replication stepdown behavior. This behavior should instead be moved to shutdownServer in db.cpp. Before that can be done, however, we'd need to remove the remaining references to the global inShutdown() flag, since you cannot run the stepdown behavior after the global flag is set. The global flag makes orderly shutdown generally difficult, anyways, so this change is desirable.

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