[SERVER-74433] Embedded periodic jobs can access runner after destruction Created: 28/Feb/23  Updated: 29/Oct/23  Resolved: 01/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: Gregory Noma Assignee: Gregory Noma
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-74352 Use throughput probing by default Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2023-03-06
Participants:

 Description   

PeriodicRunnerEmbedded::PeriodicJobImpl holds a pointer to PeriodicRunnerEmbedded, and when the job is stopped it uses that pointer to take the mutex of the runner. This can be an issue because the periodic runner lives in the service context while the periodic job anchors often live in decorations on the service context; thus in these cases the periodic runner will be destructed before the job anchor. Then when the job anchor is destructed and attempts to stop, it will try to access the already-freed runner.



 Comments   
Comment by Githook User [ 01/Mar/23 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-74433 Stop jobs upon destruction of embedded periodic runner
Branch: master
https://github.com/mongodb/mongo/commit/06c0e32b550363f92f2fe7c5bb91f900a67c04b4

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