[SERVER-70151] ServiceExecutorSynchronous thread_local-related leaks (revert) Created: 30/Sep/22  Updated: 29/Oct/23  Resolved: 24/Jan/23

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

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-70804 Improve SessionWorkflow benchmarks Closed
is depended on by SERVER-68875 Reflow the SessionWorkflow loop Closed
Duplicate
is duplicated by SERVER-71381 ReservedServiceExecutor: actively rec... Closed
Problem/Incident
causes SERVER-71702 adjust max_conns_override.js expectation Closed
Related
is related to SERVER-69905 Improve ServiceExecutorSynchronous wo... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

only repro is running the benchmark with the benchmarks_orphaned on rhel80-debug-asan as in the linked BF-26477.

Sprint: Service Arch 2022-10-17, Service Arch 2022-10-31, Service Arch 2022-11-14, Service Arch 2022-11-28, Service Arch 2022-12-12, Service Arch 2023-02-06
Participants:
Linked BF Score: 162

 Description   

(To fix BF-26477)

The service_executor_bm C++ benchmark creates service worker threads in a loop, measuring the speed of this operation.

Under ASAN this causes an accumulation of mmap-resident AsanThread objects that ASAN uses to track each thread, exhuasting the resource limit after roughly 64ki threads have been made. There are not 64k threads in the system. There are only a few at a time, but the ASAN-allocated resources of dead threads linger.

This may be related to these service worker threads being detached.

It may be some other leak of the pthreads in the code under test.



 Comments   
Comment by Githook User [ 24/Jan/23 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: Revert "SERVER-70151 no thread_locals in ServiceExecutorSynchronous"
Branch: master
https://github.com/mongodb/mongo/commit/73288a29338cee5bce896493a440ab968a9c6fb9

Comment by Billy Donahue [ 24/Jan/23 ]

Reverting this service executor work in light of the performance changes attached to it.

Revert: https://github.com/10gen/mongo/pull/10011

Comment by Billy Donahue [ 30/Nov/22 ]

ServiceExecutorSynchronous and ServiceExecutorReserved rewritten and share a base class.

Comment by Githook User [ 29/Nov/22 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-70151 no thread_locals in ServiceExecutorSynchronous
Branch: master
https://github.com/mongodb/mongo/commit/bdd6f97927ef265a26763f5986d185c75862650c

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