修复 Agent Runtime 锁等待竞态
延长运行时任务锁的有界等待窗口。 避免慢速磁盘或 CI 负载下误报 Agent 正在执行。
This commit is contained in:
@@ -2403,13 +2403,17 @@ pub(super) fn try_acquire_game_creator_agent_runtime_task_lock_with_wait(
|
||||
root: &Path,
|
||||
agent_id: &str,
|
||||
) -> Result<Option<AgentRuntimeTaskLock>, String> {
|
||||
for attempt in 0..25 {
|
||||
// Runtime state transitions can persist several audit projections while holding
|
||||
// the lane lock. Keep the wait bounded, but allow a slow CI/disk-backed
|
||||
// transition to finish before reporting a false busy error.
|
||||
const MAX_ATTEMPTS: usize = 100;
|
||||
for attempt in 0..MAX_ATTEMPTS {
|
||||
if let Some(runtime_lock) =
|
||||
try_acquire_game_creator_agent_runtime_task_lock(root, agent_id)?
|
||||
{
|
||||
return Ok(Some(runtime_lock));
|
||||
}
|
||||
if attempt < 24 {
|
||||
if attempt + 1 < MAX_ATTEMPTS {
|
||||
std::thread::sleep(Duration::from_millis(10));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user