[SERVER-63674] Create a server parameter for ServiceEntryPointImpl::shutdownAndWait Created: 15/Feb/22  Updated: 29/Oct/23  Resolved: 24/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Daniel Morilha (Inactive) Assignee: Daniel Morilha (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-63768 Create a manually triggered evergreen... Closed
Related
related to SERVER-57427 Avoid special-case handling in Servic... Closed
related to SERVER-52110 Create feature flag for Global clean ... Closed
related to SERVER-52413 Enable feature flag for Global clean ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-03-07
Participants:
Story Points: 2

 Description   

ServiceEntryPointImpl::shutdownAndWait is currently held behind a compilation flag and is only called when the code is instrumented with either thread or address sanitizers. A lot of code has been written taking this ill formed behavior into consideration which now makes it trickier to get it fixed - by removing the compilation flag few dozen of tests start failing. Also, the team isn't confident about the overall impact it would have on a production environment.

While consulting with other peers from the Service Arch team, a good approach towards solving it is running ServiceEntryPointImpl::shutdownAndWait conditioned to a server parameter. This way, builds can be triggered as needed and BFs opened accordingly.

The overarching goal is to eventually turn the flag on by default.

 bool ServiceEntryPointImpl::shutdown(Milliseconds timeout) {
+    bool shouldShutdownAndWait = feature_flags::gFeatureFlagShutdownAndWait.isEnabledAndIgnoreFCV();
+
 #if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
     // When running under address sanitizer, we get false positive leaks due to disorder around
     // the lifecycle of a connection and request. When we are running under ASAN, we try a lot
     // harder to dry up the server from active connections before going on to really shut down.
-    return shutdownAndWait(timeout);
-#else
-    return true;
+    shouldShutdownAndWait = true;
 #endif
+
+    if (shouldShutdownAndWait)
+        return shutdownAndWait(timeout);
+    else
+        return true;
 }



 Comments   
Comment by Githook User [ 22/Feb/22 ]

Author:

{'name': 'Daniel Morilha', 'email': 'daniel.morilha@mongodb.com', 'username': 'daniel-mdb'}

Message: SERVER-63674 Create a FeatureFlag for ServiceEntryPointImpl::shutdownAndWait
Branch: master
https://github.com/mongodb/mongo/commit/762a643913be8de814c69cdf37322b2b803170c7

Comment by Daniel Morilha (Inactive) [ 22/Feb/22 ]

server parameter is joinIngressSessionsOnShutdown

Generated at Thu Feb 08 05:58:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.