mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:51:26 +00:00
fix(sandbox): serialize registry mutations and lock usage
This commit is contained in:
@@ -375,6 +375,7 @@ export async function acquireSessionWriteLock(params: {
|
||||
timeoutMs?: number;
|
||||
staleMs?: number;
|
||||
maxHoldMs?: number;
|
||||
allowReentrant?: boolean;
|
||||
}): Promise<{
|
||||
release: () => Promise<void>;
|
||||
}> {
|
||||
@@ -394,8 +395,9 @@ export async function acquireSessionWriteLock(params: {
|
||||
const normalizedSessionFile = path.join(normalizedDir, path.basename(sessionFile));
|
||||
const lockPath = `${normalizedSessionFile}.lock`;
|
||||
|
||||
const allowReentrant = params.allowReentrant ?? true;
|
||||
const held = HELD_LOCKS.get(normalizedSessionFile);
|
||||
if (held) {
|
||||
if (allowReentrant && held) {
|
||||
held.count += 1;
|
||||
return {
|
||||
release: async () => {
|
||||
|
||||
Reference in New Issue
Block a user