Skip to main content

Stop one running job

POST 

/session/jobs/:jobId/signal

Asks Peen to stop one job's process group. The job's process runs under the session's worker, so Peen sends the request to that worker. stop sends SIGTERM, then SIGKILL if the process group is still running 10 seconds later. kill sends SIGKILL at once.

The call returns 202 as soon as the request is recorded and the signal is dispatched. It does not wait for the process to exit. Read the job from GET /session/jobs or its output endpoint to see the final state, normally signalled.

Every call adds a record to the job's signal history (GET /session/jobs/{jobId}/signals). A request for a job that is not running, or whose worker is gone, is not an error: Peen records it as not accepted, changes nothing, and returns signalled: false with the job's current state.

  • Errors: 400 VALIDATION_FAILED when the body is missing, signal is missing or not stop or kill, or the body has another field. 404 SESSION_NOT_FOUND when the session does not exist, and 404 NOT_FOUND (job not found) when it has no job with this ID.

Request​

Responses​

The request was recorded. signalled says whether it reached a running process.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.