lab5: исправления по ревью

Concurrent complete no longer deletes the shared verified source; admission is atomic and covers pending presign rows; relay reconciles queued jobs lost to dead-lettering; failed staging is protected until failed_retention; timestamps normalized to UTC; reprocess prefers the durable original and keeps job->attachment lock order; heartbeat errors no longer burn attempts; confirm timeout enforced; pinned images and sanitized health responses.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 23:13:44 +03:00
parent 4bdcac3dfa
commit 9d7a0acb5a
40 changed files with 592 additions and 521 deletions
+8 -1
View File
@@ -225,7 +225,14 @@ func (w *Worker) process(
return
case <-ticker.C:
ok, err := w.repo.Heartbeat(jobCtx, job.ID, job.Attempt, w.config.Owner, w.config.LeaseTTL)
if err != nil || !ok {
if err != nil {
// A DB blip is not proof that the lease is gone. Keep trying;
// the fencing CAS still prevents a stale commit.
w.log.WarnContext(jobCtx, "heartbeat failed", slog.Any("error", err))
continue
}
if !ok {
leaseLost = true
cancel()