[SERVER-50452] Make destruction of ServiceExecutorFixed deterministic Created: 21/Aug/20  Updated: 29/Oct/23  Resolved: 12/Sep/20

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

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service arch 2020-09-07, Service arch 2020-09-21
Participants:
Linked BF Score: 0

 Description   

ServiceExecutorFixed associates each executor thread with an instance of ExecutorThreadContext (defined here), which enables executor threads to keep track of the recursion depth and maintain the number of running executor threads. Each instance of ExecutorThreadContext has a weak-ptr to its corresponding service executor, which is promoted to a shared-ptr at the time of initialization and termination of the executor thread (see here).

As a result, executor threads could reference the corresponding service executor at times (through the aforementioned shared-ptr), which complicates reasoning about the destruction time of the service executor object. This is especially problematic in this test, which relies on the destruction of the service executor object before leaving the test.

This ticket should provide the means to enforce/ensure destruction of the service executor object, at least in the context of unit-tests. A possible solution is introducing a failpoint that blocks the caller until the last executor thread returns.



 Comments   
Comment by Githook User [ 23/Oct/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-50452 Make destruction of ServiceExecutorFixed deterministic

This commit introduces new fail-points to allow unit-tests
deterministically examine creation and return of executor threads.
Branch: fixed_thread_pool_handshaking
https://github.com/mongodb/mongo/commit/8cff99b2c4710a0e8abb7a0631d24385092697b4

Comment by Githook User [ 12/Sep/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-50452 Make destruction of ServiceExecutorFixed deterministic

This commit introduces new fail-points to allow unit-tests
deterministically examine creation and return of executor threads.
Branch: master
https://github.com/mongodb/mongo/commit/86bc3de7ead3c1229530d05b192ba8ee43d5132c

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