-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
📁 Location
- Files:
tests/test_nest_MPI_threading/*.py(3 files) - Category: error-handling
- Severity: high
- Hashes:
4149d9fe3929,3c8fe0ea688c,0330af459e7e
🔍 Problem
MPI communication loops use while True: without timeout protection. If communication fails, these loops block forever.
Affected Files
record_region_activity_multiple.py:43input_region_activity_multiple.py:47input_current_region_activity_multiple.py:47
💡 Fix
# Before
while True:
comm.Recv(...)
# process
# After
import time
start_time = time.time()
TIMEOUT_SECONDS = 300 # 5 minutes
while time.time() - start_time < TIMEOUT_SECONDS:
comm.Recv(...)
# process
else:
raise TimeoutError(f"MPI communication timeout after {TIMEOUT_SECONDS}s")🧪 TDD Evidence
Test file: tests/evidence/test_nest_mpi_races.py
test_infinite_loop_timeout_patterndemonstrates proper timeout handling
tests/evidence/test_nest_mpi_races.py::TestNestMpiRaceConditions::test_infinite_loop_timeout_pattern PASSED
Run: 2026-02-05-1228 | Auto-generated by UltraQA
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels