docs: Document per-job stop capability for concurrent workers#649
docs: Document per-job stop capability for concurrent workers#649promptless[bot] wants to merge 1 commit into
Conversation
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 | ||
|
|
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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.