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
+9 -2
View File
@@ -113,7 +113,7 @@ func declareTopology(channel *amqp.Channel, cfg Config) error {
queue, err := channel.QueueDeclare(cfg.Queue, true, false, false, false, amqp.Table{
"x-queue-type": "quorum",
"x-delivery-limit": int32(8),
"x-delivery-limit": int32(100),
"x-delayed-retry-type": "all",
"x-delayed-retry-min": int32(5000),
"x-delayed-retry-max": int32(60000),
@@ -186,7 +186,14 @@ func (c *Client) PublishConfirmed(ctx context.Context, routingKey string, messag
return fmt.Errorf("publish job: %w", err)
}
confirmed, err := confirmation.WaitContext(ctx)
confirmCtx := ctx
if c.cfg.ConfirmTimeout > 0 {
var cancel context.CancelFunc
confirmCtx, cancel = context.WithTimeout(ctx, c.cfg.ConfirmTimeout)
defer cancel()
}
confirmed, err := confirmation.WaitContext(confirmCtx)
if err != nil {
return fmt.Errorf("await publisher confirm: %w", err)
}