Skip to content

Commit

Permalink
lightning: Change how the ID of taskCfg.TaskID is generated (#55505) (
Browse files Browse the repository at this point in the history
#57018)

close #55384
  • Loading branch information
ti-chi-bot authored Nov 4, 2024
1 parent 9cd5d14 commit 3378d7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion br/pkg/lightning/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"encoding/pem"
"fmt"
"io"
"math/big"
"net"
"net/http"
"net/http/pprof"
Expand Down Expand Up @@ -350,8 +351,12 @@ func (l *Lightning) RunOnceWithOptions(taskCtx context.Context, taskCfg *config.
if err := taskCfg.Adjust(taskCtx); err != nil {
return err
}
r, err := rand.Int(rand.Reader, big.NewInt(1<<63-1))
if err != nil {
return err
}
taskCfg.TaskID = r.Int64()

taskCfg.TaskID = time.Now().UnixNano()
failpoint.Inject("SetTaskID", func(val failpoint.Value) {
taskCfg.TaskID = int64(val.(int))
})
Expand Down

0 comments on commit 3378d7a

Please sign in to comment.