ArchiveBox/archivebox/services
Nick Sweeting a48ce6871b
Make per-snapshot crawl seal idempotent against the run_snapshot race
run_snapshot calls load_snapshot_payload which replaces self.crawl with
a fresh Crawl model instance every time. When N snapshot tasks finish
near-simultaneously their independent self.crawl/SM pairs all see
'STARTED + no open snapshots' and race on sm.seal(). The first task
drives the SM to a final state (engine.running becomes False), but the
loser's current_state still reads STARTED off its stale model field,
so python-statemachine then raises 'Can't Seal when in Started.' and
fails the whole snapshot task even though the crawl is already sealed.

Refresh the row right before the call so the guard sees the committed
status, and treat TransitionNotAllowed as the expected idempotent
no-op when another task already drove the transition.
2026-06-13 20:17:30 -07:00
..
__init__.py Project abxpkg binary events 2026-06-01 02:02:42 -07:00
archive_result_service.py release: archivebox 0.9.34rc67 2026-06-07 04:06:45 -07:00
binary_service.py release: archivebox 0.9.35rc2 2026-06-08 05:03:19 -07:00
crawl_service.py Refactor plugins search progress and config flows 2026-06-01 00:08:27 -07:00
machine_service.py release: archivebox 0.9.34rc39 2026-06-03 17:19:48 -07:00
process_service.py release: archivebox 0.9.34rc35 2026-06-01 19:35:35 -07:00
runner.py Make per-snapshot crawl seal idempotent against the run_snapshot race 2026-06-13 20:17:30 -07:00
snapshot_service.py release: archivebox 0.9.34rc35 2026-06-01 19:35:35 -07:00
tag_service.py update working changes 2026-03-25 05:36:07 -07:00