Skip to content

Commit

Permalink
Added info about job cancellation (#3518)
Browse files Browse the repository at this point in the history
* Added info about job cancellation

* Addressed comments

* Update docs/design/jobcancellation.md

Co-authored-by: Alexander Smolyakov <[email protected]>

Co-authored-by: Alexander Smolyakov <[email protected]>
  • Loading branch information
Anatoly Bolshakov and Alexander Smolyakov authored Sep 2, 2021
1 parent 3abad60 commit 4dc0b6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/design/jobcancellation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Agent jobs cancellation

Agent receives cancellation signal from server - which initiates job cancellation process.

## How agent cancells job execution in details?

When agent receives cancellation signal from server (this usually happens when job execution is timed out, or it was cancelled manually by user) - it sends SIGINT signal to the child process responsible for task execution.

If child process has been successfully stopped by SIGINT signal - agent considers that task has been cancelled; otherwise, the agent will send SIGTERM signal to this process.

You can find relevant source code [here](https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Agent.Sdk/ProcessInvoker.cs#L418).

0 comments on commit 4dc0b6e

Please sign in to comment.