You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Context cancelled or timed out - rollback already acquired locks
302
+
logger.WarnfContext(ctx, "Failed to acquire lock for enrollment ID [%s] due to context cancellation, rolling back %d acquired locks", id, len(acquired))
303
+
for_, acquiredID:=rangeacquired {
304
+
ifs, ok:=d.eIDsLocks.Load(acquiredID); ok {
305
+
s.(*semaphore.Weighted).Release(1)
306
+
}
307
+
}
308
+
returnerrors.Wrapf(err, "failed to acquire lock for enrollment ID [%s]", id)
309
+
}
310
+
acquired=append(acquired, id)
293
311
logger.DebugfContext(ctx, "Acquire locks for [%s:%v] enrollment id done", anchor, id)
294
312
}
313
+
314
+
// Store anchor mapping only after successfully acquiring all locks
315
+
d.eIDsLocks.Store(anchor, dedup)
295
316
logger.DebugfContext(ctx, "Acquire locks for [%s:%v] enrollment ids...done", anchor, dedup)
0 commit comments