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:
@@ -120,6 +120,27 @@ def main():
|
||||
'old job not superseded or new job not ready')
|
||||
print('worker up: reprocessed upload reached ready at pipeline 2, v1 superseded')
|
||||
|
||||
# 5. A pipeline version the worker cannot execute must be refused by the
|
||||
# operator CLI before any state change; the accepted v1 upload keeps its
|
||||
# job and finishes normally instead of being superseded into queued.
|
||||
compose('stop', 'worker')
|
||||
try:
|
||||
preserved, _ = client.attachment(alice, chat)
|
||||
check(preserved['status'] == 'queued', 'unsupported-pipeline fixture must be queued')
|
||||
refused = jobctl('reprocess', '-attachment', preserved['id'], '-pipeline', '3', check=False)
|
||||
check(refused.returncode != 0 and 'unsupported pipeline version 3' in refused.stderr,
|
||||
'unsupported pipeline version was not rejected')
|
||||
check(psql("select status from attachment_jobs where attachment_id='%s' and pipeline_version=1" % preserved['id']) == 'queued',
|
||||
'v1 job changed by rejected reprocess')
|
||||
print('worker down: reprocess pipeline 3 refused, v1 job untouched')
|
||||
finally:
|
||||
compose('up', '-d', '--no-deps', 'worker', check=False)
|
||||
|
||||
client.wait_ready(alice, preserved, wait_seconds=90)
|
||||
check(psql("select pipeline_version from attachments where id='%s'" % preserved['id']) == '1',
|
||||
'rejected reprocess changed serving version')
|
||||
print('worker up: preserved upload reached ready at pipeline 1')
|
||||
|
||||
print('PASS: lab5 async worker/broker durability')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user