Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: align LogRun lock value with retry path so retry-items can read …
…runID
  • Loading branch information
xueyizheng committed Jun 1, 2026
commit 5759b5660d93565fa05e26679b14e573daecbf10
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func (e *ExptMangerImpl) unlockCompletingRun(ctx context.Context, exptID, exptRu

func (e *ExptMangerImpl) LogRun(ctx context.Context, exptID, exptRunID int64, mode entity.ExptRunMode, spaceID int64, itemIDs []int64, session *entity.Session) error {
duration := time.Duration(e.configer.GetExptExecConf(ctx, spaceID).GetZombieIntervalSecond()) * time.Second
locked, err := e.mutex.LockBackoff(ctx, e.makeExptMutexLockKey(exptID), duration, time.Second)
locked, _, err := e.mutex.BackoffLockWithValue(ctx, e.makeExptMutexLockKey(exptID), strconv.FormatInt(exptRunID, 10), duration, time.Second)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ func TestExptMangerImpl_LogRun(t *testing.T) {
setup: func() {
mgr.mutex.(*lockMocks.MockILocker).
EXPECT().
LockBackoff(ctx, gomock.Any(), gomock.Any(), time.Second).
Return(true, nil)
BackoffLockWithValue(ctx, gomock.Any(), "456", gomock.Any(), time.Second).
Return(true, "", nil)

mgr.mtr.(*metricsMocks.MockExptMetric).
EXPECT().
Expand Down Expand Up @@ -595,8 +595,8 @@ func TestExptMangerImpl_LogRun(t *testing.T) {
setup: func() {
mgr.mutex.(*lockMocks.MockILocker).
EXPECT().
LockBackoff(ctx, gomock.Any(), gomock.Any(), time.Second).
Return(false, nil)
BackoffLockWithValue(ctx, gomock.Any(), "456", gomock.Any(), time.Second).
Return(false, "", nil)
},
wantErr: true,
},
Expand All @@ -609,8 +609,8 @@ func TestExptMangerImpl_LogRun(t *testing.T) {
setup: func() {
mgr.mutex.(*lockMocks.MockILocker).
EXPECT().
LockBackoff(ctx, gomock.Any(), gomock.Any(), time.Second).
Return(true, nil)
BackoffLockWithValue(ctx, gomock.Any(), "456", gomock.Any(), time.Second).
Return(true, "", nil)

mgr.mtr.(*metricsMocks.MockExptMetric).
EXPECT().
Expand All @@ -632,8 +632,8 @@ func TestExptMangerImpl_LogRun(t *testing.T) {
setup: func() {
mgr.mutex.(*lockMocks.MockILocker).
EXPECT().
LockBackoff(ctx, gomock.Any(), gomock.Any(), time.Second).
Return(true, nil)
BackoffLockWithValue(ctx, gomock.Any(), "456", gomock.Any(), time.Second).
Return(true, "", nil)

mgr.mtr.(*metricsMocks.MockExptMetric).
EXPECT().
Expand Down