mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 15:30:21 +00:00
* fix(cron): resolve isolated session deadlock (#44805) Map cron lane to nested in resolveGlobalLane to prevent deadlock when isolated cron jobs trigger inner operations (e.g. compaction). Outer execution holds the cron lane slot; inner work now uses nested lane. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(changelog): add cron isolated deadlock note --------- Co-authored-by: zhujian <zhujianxyz@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
624 B
TypeScript
20 lines
624 B
TypeScript
import { CommandLane } from "../../process/lanes.js";
|
|
|
|
export function resolveSessionLane(key: string) {
|
|
const cleaned = key.trim() || CommandLane.Main;
|
|
return cleaned.startsWith("session:") ? cleaned : `session:${cleaned}`;
|
|
}
|
|
|
|
export function resolveGlobalLane(lane?: string) {
|
|
const cleaned = lane?.trim();
|
|
// Cron jobs hold the cron lane slot; inner operations must use nested to avoid deadlock.
|
|
if (cleaned === CommandLane.Cron) {
|
|
return CommandLane.Nested;
|
|
}
|
|
return cleaned ? cleaned : CommandLane.Main;
|
|
}
|
|
|
|
export function resolveEmbeddedSessionLane(key: string) {
|
|
return resolveSessionLane(key);
|
|
}
|