This commit is contained in:
alex.sharov 2023-04-19 12:57:22 +07:00
parent b2f5bbbff9
commit 8a7f9b5163
2 changed files with 12 additions and 1 deletions

View File

@ -130,6 +130,14 @@ func (q *QueueWithRetry) RetriesLen() (l int) {
q.retiresLock.Unlock()
return l
}
func (q *QueueWithRetry) RetryTxNumsList() (out []uint64) {
q.retiresLock.Lock()
for _, t := range q.retires {
out = append(out, t.TxNum)
}
q.retiresLock.Unlock()
return out
}
func (q *QueueWithRetry) Len() (l int) { return q.RetriesLen() + len(q.newTasks) }
// Add "new task" (which was never executed yet). May block internal channel is full.

View File

@ -302,7 +302,10 @@ func ExecV3(ctx context.Context,
case <-logEvery.C:
stepsInDB := rawdbhelpers.IdxStepsCountV3(tx)
log.Warn("[dbg] stat of in-queue", "newTasks", in.NewTasksLen(), "retires", in.RetriesLen())
l := in.RetryTxNumsList()
if len(l) > 0 {
log.Warn("[dbg] stat of in-queue", "newTasks", in.NewTasksLen(), "retires", in.RetriesLen(), "txNums", fmt.Sprintf("%d", l))
}
progress.Log(rs, in, rws, rs.DoneCount(), inputBlockNum.Load(), outputBlockNum.Get(), outputTxNum.Load(), ExecRepeats.Get(), stepsInDB)
if agg.HasBackgroundFilesBuild() {
log.Info(fmt.Sprintf("[%s] Background files build", logPrefix), "progress", agg.BackgroundProgress())