Merge pull request #5060 from vladmandic/fix/queue-lock-exception-suppression

fix(queue): stop the queue lock from suppressing exceptions
This commit is contained in:
Vladimir Mandic
2026-08-26 07:31:39 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class Queue:
if _queue_debug:
fn = f'{sys._getframe(3).f_code.co_name}:{sys._getframe(2).f_code.co_name}:{sys._getframe(1).f_code.co_name}' # pylint: disable=protected-access
log.debug(f'Queue: unlock state={_queue_lock.locked()} fn={fn}')
return _queue_lock
# no return: a truthy __exit__ suppresses the exception in flight
queue_lock = Queue() # public lock for external use
+4
View File
@@ -307,6 +307,10 @@ def run(selected: models_def.Model, *,
if err:
raise VideoError(err, 500)
if processed is None or (len(processed.images) == 0 and processed.bytes is None):
# process_images swallows the interrupt assertion, so an empty result is the only place
# a cancel and a genuine failure are still distinguishable
if shared.state.interrupted or shared.state.skipped:
raise VideoError('interrupted', 499)
raise VideoError('processing failed', 500)
log.info(f'Video: name="{selected.name}" cls={shared.sd_model.__class__.__name__} frames={len(processed.images)} time={t1-t0:.2f}')