lab5: закрытие второго ревью

Validate the PNG raster itself: exact Adam7/non-interlaced row layout, scanline filter bytes, palette/PLTE rules, bounded streaming without keeping the raster. Settle an attachment as failed when a newer pipeline fails before any version was published, while keeping a ready serving version intact. Reject unsupported pipeline versions in jobctl before changing state.
This commit is contained in:
Vladislav Kunetskiy
2026-10-31 01:06:43 +03:00
parent b965350cc9
commit 8c0a455aa5
14 changed files with 478 additions and 112 deletions
@@ -998,7 +998,15 @@ func failJobTx(
return fmt.Errorf("mark job failed: %w", mapError(err))
}
if job.PipelineVersion == attachment.PipelineVersion {
// A failed job settles the attachment when its version is the serving one,
// or when it is a newer version attempted before any version was
// published (reprocess from queued/processing/failed). A newer version
// failing while an older ready version is serving must not disturb the
// published version: it stays ready and downloadable.
settlesAttachment := job.PipelineVersion == attachment.PipelineVersion ||
(job.PipelineVersion > attachment.PipelineVersion && attachment.Status != domain.AttachmentReady)
if settlesAttachment {
_, err = tx.Exec(ctx, `
UPDATE attachments
SET status = 'failed',