Skip to content

Allow Work continuation after stopping a prepared worker - #172

Merged
sergeytolkachyov merged 2 commits into
devfrom
fix/171-resume-cancelled-worker
Nov 25, 2026
Merged

sergeytolkachyov merged 2 commits into
devfrom
fix/171-resume-cancelled-worker

Conversation

@sergeytolkachyov

@sergeytolkachyov sergeytolkachyov commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Fixes #171

After worker-run prepare followed by worker-run stop with no intervening launch, SQLite keeps the original attempt in the prepared phase and records its public status as cancelled. The continuation guard now recognizes this state when collection is pending and both the launch token and process identity are absent. It then checks the applicable Workplace leases. This allows creating and resuming a v2 continuation for the same run, assignment and context.

The release regression exercises a real prepare and stop, an active lease on the cancelled attempt, successful continuation after lease release and a newly prepared attempt that blocks resume again. The English and Russian continuation guides describe this behavior.

The previous read-only investigation reproduced the problem on public 1.3.0 and the 1.3.1 snapshot. The integration base 534ecbb2 reproduced it again with the project's installed launcher and a registered driver. The same four issue commands returned a v2 continuation and the original run, assignment and context on 1b9646b25564590be1a0eb77ac078d58f321ad4e. This was verified on Windows and Ubuntu under WSL2.

The regression and the expanded issue scenario passed on both systems. CLI, stdio MCP and a temporary HTTP App Server each created and resumed the selected Work. A matching active lease returned active_lease for both operations. Nine inconsistent or busy record cases and a genuinely running worker were rejected. Retrying an interrupted Work cancellation completed successfully and preserved the worker attempt.

The four adjacent pytest modules passed 223 tests on Windows with one Linux-specific skip and all 224 on Linux tmpfs. Two SQLite concurrency tests exceeded their contention budget on the local WSL2 ext4 disk on both the base and candidate. Both passed on the native Ubuntu runner. The released continuation regression can be run with python -B tools/smoke_continuation_work.py. Native Ubuntu checks

@sergeytolkachyov
sergeytolkachyov merged commit 81e98a5 into dev Nov 25, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Продолжение Work блокируется после отмены незапущенного worker

1 participant