-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Fully Compatible
-
ALL
-
Service Arch 2020-08-10
-
0
The atomic variable used in ServiceExecutorFixedFixture::FlattenRecursiveScheduledTasks (see here) to track the recursion depth should be replaced by a thread-local integer, making it safe for multiple executor threads to run tasks without concurrently bumping up the recursion depth.
Having a thread-local variable to track recursion depth is necessary since another executor thread (i.e., exec2) may start executing a task immediately after it's been scheduled by another thread (i.e., exec1), making it appear as the thread that scheduled the task (exec1) is executing it recursively.