Skip to content

ThreadPoolTest.NoWorkAfterShutdown hangs indefinitely under TSan #145

@mvillmow

Description

@mvillmow

Summary

ThreadPoolTest.NoWorkAfterShutdown hangs indefinitely when run under ThreadSanitizer (TSan), causing the CI job to time out.

Test Location

tests/unit/test_thread_pool.cpp:133

Repro

make compile.debug.tsan.native
./build/x86.debug.tsan/bin/concurrency_unit_tests --gtest_filter=ThreadPoolTest.NoWorkAfterShutdown
# Hangs indefinitely

Root Cause (Suspected)

The test calls pool.submit() after pool.shutdown(). Under TSan's overhead, this appears to cause a deadlock. The likely issue is that TSan slows execution enough that a race condition in the ThreadPool's shutdown/submit path manifests as a hang.

Current Workaround

Test disabled via DISABLED_NoWorkAfterShutdown prefix.

Investigation Needed

  1. Reproduce the hang under TSan locally
  2. Identify whether the ThreadPool has a deadlock in the submit-after-shutdown path
  3. Either fix the race or document why submit-after-shutdown is safe to be a no-op

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions