InvokeAI/invokeai/app/services
psychedelicious 50dd569411 fix(processor): race condition that could result in node errors not getting reported
I had set the cancel event at some point during troubleshooting an unrelated issue. It seemed logical that it should be set there, and didn't seem to break anything. However, this is not correct.

The cancel event should not be set in response to a queue status change event. Doing so can cause a race condition when nodes are executed very quickly.

It's possible that a previously-executed session's queue item status change event is handled after the next session starts executing. The cancel event is set and the session runner sees it aborting the session run early.

In hindsight, it doesn't make sense to set the cancel event here either. It should be set in response to user action, e.g. the user cancelled the session or cleared the queue (which implicitly cancels the current session). These events actually trigger the queue item status changed event, so if we set the cancel event here, we'd be setting it twice per cancellation.
2024-05-24 20:02:24 +10:00
..
board_image_records feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
board_images feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
board_records feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
boards feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
bulk_download feat(bulk_download): update response model, messages 2024-03-01 10:42:33 +11:00
config [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
download feat(mm): handle PC_PATH_MAX on external drives on macOS 2024-04-30 07:57:03 -04:00
events feat(events): add enriched errors to events 2024-05-24 20:02:24 +10:00
image_files feat(app): simplified create image API 2024-05-18 09:04:37 +10:00
image_records fix(app): pass image metadata as stringified json 2024-05-18 09:04:37 +10:00
images fix(app): type annotations in images service 2024-05-18 09:04:37 +10:00
invocation_cache fix(nodes): correctly serialize outputs 2024-03-06 08:14:12 -05:00
invocation_stats fix(nodes): fix typing on stats service context manager 2024-03-01 10:42:33 +11:00
item_storage revert(nodes): revert making tensors/conditioning use item storage 2024-03-01 10:42:33 +11:00
model_images docs(mm): update comment about model images 2024-03-08 12:26:35 +11:00
model_install Re-enable app shutdown actions (#6244) 2024-04-19 06:45:42 -04:00
model_load feat(events): add submodel_type to model load events 2024-03-14 18:29:55 +05:30
model_manager [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
model_records Fix minor bugs involving model manager handling of model paths (#6024) 2024-03-22 01:14:45 +00:00
names feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
object_serializer tidy(app): remove unused class 2024-04-23 17:12:14 +10:00
session_processor fix(processor): race condition that could result in node errors not getting reported 2024-05-24 20:02:24 +10:00
session_queue tidy(queue): delete unused delete_queue_item method 2024-05-24 20:02:24 +10:00
shared feat(db): add error_type, error_message, rename error -> error_traceback to session_queue table 2024-05-24 20:02:24 +10:00
urls cleanup 2024-03-06 21:57:41 -05:00
workflow_records chore(nodes): update default workflows for v4 2024-03-22 02:21:33 -07:00
__init__.py all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
invocation_services.py tidy(mm): ModelImages service 2024-03-06 21:57:41 -05:00
invoker.py refactor(nodes): merge processors 2024-03-01 10:42:33 +11:00