user3313077
user3313077

Reputation:

How can I abort a jenkins build

I start the build process for a project inside Jenkins I am unable to stop it I tried pressing the cross button but it does not stop the build process. How do I kill the build inside Jenkins, The build process is just hanging. I am new to Jenkins btw

Upvotes: 3

Views: 16838

Answers (2)

Slav
Slav

Reputation: 27485

As is explained here about Aborting a Jenkins Build, when you click the X (abort link), it sends an OS termination signal. Whether that signal is processed by your underlying process or not depends on how busy that process is and how well it is coded:

  • Waiting for a completion of a child process (for example, maybe the build is running Ant) is an interruption point. That means if the executor was doing that, it gets interrupted instantaneously.
  • Waiting for a computation on a slave is an interruption point.
  • Waiting for file or network I/O is not an interruption point. This often causes the problem where a build appears to be un-abortable. For example, checking out a Subversion repository falls in this category.
  • Normal computation is also not an interruption point.

Read the above link for more information on troubleshooting.

Upvotes: 1

Trikaldarshiii
Trikaldarshiii

Reputation: 11314

You can use the follwoing to kill the process

java -Dhudson.util.ProcessTree.disable=true -jar jenkins.war

follow the link for more details

and if you have started build remotely then you can do the following.

If the build has started, by GET on:

http://<Jenkins_URL>/job/<Job_Name>/<Build_Number>/stop

Will stop/cancel the current build.

If the build has not started, you have the queueItem, then POST on:

http://<Jenkins_URL>/queue/cancelItem?id=<queueItem>

Assume your Jenkins has not been secured, otherwise you need to add ?token=TOKEN to the end of the urls, where TOKEN can be the security token of a user with sufficient privileges to cancel builds.

Upvotes: 2

Related Questions