[SERVER-67232] Avoid accessing uninitialized resources during `mongos` shutdown Created: 13/Jun/22  Updated: 07/Jul/22  Resolved: 07/Jul/22

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

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Operating System: ALL
Steps To Reproduce:

Reproducing the issue is quite easy: start a mongos using an already in-use listening port. The issue is reliably reproducible using v4.0.28.

Sprint: Service Arch 2022-07-11
Participants:
Case:

 Description   

The shutdown task for mongos doesn't consider exceptions that may occur before the initialization of global objects (and decorations). For example, LogicalSessionCache is accessed from here on v4.0.28, while it is initialized from here and any error that may occur before this point will cause a segmentation fault during shutdown.

This ticket should identify any resource that is accessed by the shutdown task but may not be ready/initialized during shutdown. The shutdown task must ensure each resource is valid before accessing it.

AC: Investigate if this behavior exists on 4.2/4.4/5.0/6.0, if it does re-triage, if not, close.



 Comments   
Comment by Jason Chan [ 13/Jun/22 ]

For this ticket, I think we should investigate whether this issue exists on any version later than 4.0 (considering v4.0 is EOL'd). amirsaman.memaripour@mongodb.com confirmed the problem is not reproducible on master.

Generated at Thu Feb 08 06:07:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.