Skip to content

docs: Document per-job stop capability for concurrent workers#649

Draft
promptless[bot] wants to merge 1 commit into
mainfrom
promptless/per-job-stop-capability
Draft

docs: Document per-job stop capability for concurrent workers#649
promptless[bot] wants to merge 1 commit into
mainfrom
promptless/per-job-stop-capability

Conversation

@promptless

@promptless promptless Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Add documentation explaining that Serverless workers processing multiple jobs concurrently can now stop individual jobs without affecting sibling jobs. Includes guidance on catching asyncio.CancelledError for resource cleanup.

Trigger Events


Tip: Planning a big docs refactor? Use Deep Analysis to get help with the heavy lifting.

Add documentation explaining that workers processing multiple jobs can
now stop individual jobs without affecting siblings when requests expire,
timeout, or are cancelled. Include guidance on catching asyncio.CancelledError
for resource cleanup in async handlers.
```

## Automatic job stopping

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added per-job stop capability section based on PR #510 which introduces JobsToStop in worker_state.py and stop_job() in rp_scale.py. The PR's inline docs in docs/serverless/worker.md confirm handlers need no changes and async handlers can catch asyncio.CancelledError.

Source: runpod/runpod-python#510


</Tip>

When a job is stopped due to timeout, expiration, or cancellation, async handlers receive an `asyncio.CancelledError`. Catch this exception to release resources, then re-raise it:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added asyncio.CancelledError handling guidance based on PR #510. The handle_job() method in rp_scale.py catches CancelledError and logs the stop, confirming this is the expected exception type for job cancellation.

Source: runpod/runpod-python#510

@mintlify

mintlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
runpod-docs 🟢 Ready View Preview Jun 9, 2026, 1:39 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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.

0 participants