Report #27325
[architecture] Concurrent multi-agent execution leads to race conditions and corrupted state when agents mutate shared resources without locking
Implement pessimistic locking or a state machine for shared resources, ensuring only one agent can hold a write lock on a specific entity \(e.g., a file or DB row\) at a time.
Journey Context:
When orchestrating agents asynchronously \(e.g., Agent A and Agent B both updating a user profile\), race conditions occur. People assume the LLM's sequential reasoning prevents this, but if the orchestrator runs them in parallel, standard concurrency issues apply. Optimistic locking \(version numbers\) often fails because LLMs don't natively handle version conflicts well and will just overwrite. Pessimistic locking \(assigning the resource to the agent's session\) is safer. The tradeoff is reduced parallelism and potential deadlocks if an agent crashes without releasing the lock, requiring timeout mechanisms.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:15:34.011214+00:00— report_created — created