fix: resolve concurrency races and overhaul test diagnostics#22
Merged
Conversation
Thread Safety Fixes: - warm_worker_pool.cpp: Fix Shutdown() data race — was accessing workers_ vector without mutex_ lock, racing with AcquireWorker(). Now collects worker pointers under lock, signals/joins outside to avoid deadlock. Upgraded all memory_order_relaxed → acquire/release for proper visibility. - dynamic_worker_coordinator.cpp: Fix recycling→shutdown race — after DoRecycle(), if NotifyShutdown() changed state to kShutdown during recycling, the worker was still scanning the pool queue and could dequeue a request it would never execute (causing caller hangs). Now breaks immediately when CAS fails. - dynamic_worker_coordinator_test.cc: Fix LeaseTimeout test taking 60s by changing recycle_duration from 60s to 200ms. The gate mechanism already keeps the worker busy; the recycle duration was only blocking shutdown unnecessarily. Test Infrastructure (dcodex-setup.sh): - Add dump_test_logs() — extracts and prints bazel test.log content on failure (was completely invisible before) - Run specific targets per sanitizer instead of //... which caused one failure to abort all others as NO STATUS - Skip MSan (matches CI — system libstdc++ not instrumented) - Add --verbose_failures and --sandbox_debug always - Add RUN_MSAN=1 env var to force-run MSan with suppressions - Separate TSan sandbox_test with constrained resources (--jobs=1) - Print color-coded summary table: PASS/FAIL/SKIPPED per sanitizer CI Workflow (linux_ci.yml): - Add dcodex-setup.sh --test as environment verification step - Add --verbose_failures to all existing test steps - Upload /tmp/dcodex-test-*.log alongside bazel-testlogs on failure
Ubuntu 24.04's system pip is installed via apt and refuses 'pip install --upgrade pip' with 'RECORD file not found'. Skip the upgrade (unnecessary) and add --break-system-packages to pip install since we're running as root in CI/Docker.
…te transitions and update setup script accordingly
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thread Safety Fixes:
warm_worker_pool.cpp: Fix Shutdown() data race — was accessing workers_ vector without mutex_ lock, racing with AcquireWorker(). Now collects worker pointers under lock, signals/joins outside to avoid deadlock. Upgraded all memory_order_relaxed → acquire/release for proper visibility.
dynamic_worker_coordinator.cpp: Fix recycling→shutdown race — after DoRecycle(), if NotifyShutdown() changed state to kShutdown during recycling, the worker was still scanning the pool queue and could dequeue a request it would never execute (causing caller hangs). Now breaks immediately when CAS fails.
dynamic_worker_coordinator_test.cc: Fix LeaseTimeout test taking 60s by changing recycle_duration from 60s to 200ms. The gate mechanism already keeps the worker busy; the recycle duration was only blocking shutdown unnecessarily.
Test Infrastructure (dcodex-setup.sh):
CI Workflow (linux_ci.yml):