Add activity tracking to prevent stall timeouts during message transfers
Add OnActivity callback to CopyDeps to prevent stall timeouts during large message transfers Implement touchReader and touchWriter wrappers to call OnActivity during FETCH and APPEND operations Add slow message logging to identify performance bottlenecks Add test case to verify activity reporting during message transfers Clean up orchestrator account reset code formatting
This commit is contained in:
@@ -306,9 +306,9 @@ func (o *Orchestrator) runAccount(ctx context.Context, task store.Task, runID in
|
||||
"dst_login": a.DstLogin, "dst_host": dstEP.Host, "dst_port": dstEP.Port,
|
||||
}})
|
||||
_ = o.store.SetAccountStatus(ctx, a.ID, "running")
|
||||
_ = o.store.SetAccountError(ctx, a.ID, "") // clear any error from a previous run
|
||||
_ = o.store.ResetAccountCounters(ctx, a.ID) // start from zero; IncAccountCounters is additive
|
||||
_ = o.store.ClearAccountErrors(ctx, a.ID) // drop last run's per-error rows
|
||||
_ = o.store.SetAccountError(ctx, a.ID, "") // clear any error from a previous run
|
||||
_ = o.store.ResetAccountCounters(ctx, a.ID) // start from zero; IncAccountCounters is additive
|
||||
_ = o.store.ClearAccountErrors(ctx, a.ID) // drop last run's per-error rows
|
||||
|
||||
// Per-account cancellable context: IMAP work uses actx (so CancelAccount
|
||||
// stops it); DB writes keep the parent ctx so status/counters persist even
|
||||
@@ -441,6 +441,10 @@ func (o *Orchestrator) runAccount(ctx context.Context, task store.Task, runID in
|
||||
IsMigrated: func(k string) (bool, error) { return o.store.IsMigrated(ctx, a.ID, k) },
|
||||
MarkMigrated: func(folder, k string) error { return o.store.MarkMigrated(ctx, a.ID, folder, k) },
|
||||
OnError: func(ref, msg string) { addErr("message", curFolder, ref, msg) },
|
||||
// Fires as bytes move within a single message's FETCH/APPEND, so the
|
||||
// stall watchdog sees a large-but-live transfer as progress instead of
|
||||
// cancelling it as a wedged connection.
|
||||
OnActivity: touch,
|
||||
OnProgress: func(c, s int) {
|
||||
touch()
|
||||
now := time.Now()
|
||||
|
||||
Reference in New Issue
Block a user