Reliability and error handling
Long-running jobs: 202, job resources and cancellation
Design the job lifecycle instead of merely increasing timeouts.
Understand the concept
Video processing or CV analysis can outlast a request. 202 means accepted, not completed or guaranteed to succeed. Expose a job resource with application states such as pending, running, succeeded, failed and cancelled. These are application states rather than replacements for HTTP status semantics.
Poll the status resource at a controlled pace using the documented contract. A completed job can provide a result representation or a separate result address. Protect jobs and results with ownership and tenant checks, and return safe error information.
A timeout does not prove that nothing was queued. Handle repeated submissions with idempotency. Cancellation can be best-effort after irreversible work. Closing a browser tab does not automatically cancel backend work. Queue capacity, retention, retries and restart behaviour are part of the operational design.
For AI analysis, video processing and exports.
Assuming AbortController guarantees cancellation of backend work.
One topic. Three levels of depth.
HTTP/1.1 202 Accepted
Location: /jobs/42The application’s monitoring address, not a completion guarantee.
This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.
Try it yourself first.
Does closing the tab automatically stop the job?
Show the solution and explanation
No: cancellation needs an explicit backend contract.No. An explicit cancellation contract and worker behaviour are needed.