Jenkins build is not timing out even when Build Timeout is explicitly mentioned - jenkins

I've mentioned build timeout in jenkins job as per attached screen shot
But even with this setting build is not timing out even after 2 -4 hrs.
I use jenkins job to do GET requests to REST end points.
There is a bug with one of the end point which results in response not being sent in required time.
Please clarify how to get time out fixed with jenkins job ?
Thanks & Regards,
Vikram

The "Abort the build if it's stuck" option is offered by the "Build Timeout Plugin".
According to the documentation of the "Build Timeout Plugin" (https://wiki.jenkins-ci.org) :
[...] depending on how a build hangs, the abort operation might not take effect.
The documentation lists a couple of possible reasons. Make sure you are not affected by one of those reasons. (I cannot tell without seeing a lot more of your configuration and precisely how you place those GET requests.)

Related

Way to make Jenkins ignore failure of post build step

I have a nice plugin called Zulip notification in Jenkins, this plugin posts the results to Zulip so people there can see whats happening. Our Zulip server is a bit unstable and goes offline every now and again, and then all the nightly builds fail.
Is there a way to configure a post build step as "best effort"? To try to run the step, but ignore failure. It's obviously nonessential in the "compile the code" view of the world.
I have looked at the "Flexible Build Step" plugin, and it seems to be able to run other plugins fine, but i dont see any "ignore error" kind of option..
Current thinking re a solution: Perhaps there is a way to get the flexible build step plugin to check if the url is online?
Ok my workaround is to use the "flexible build step" and run a batch file (thanks to this answer) to determine if url is up:
https://stackoverflow.com/a/16512781/3426514

Occasionally Jenkins Configuration Matrix jobs report failure on success

General Symptoms
We use Jenkins to build & test on multiple platforms. We use the Configuration Matrix plugin to help with this. Occasionally (increasingly often) Jenkins will mark the Configuration Matrix master job or subjobs as failed when the jobs seem to have succeeded (the console output reports success). We have no idea why this is happening. Any suggestions?
Some clues:
The exit code of the Jenkins job's script is not relevant. We've had test sub-jobs that simply exit 0 and they can still exhibit this bad behavior.
The failures are bunchy. They seem to come in groups.
The failures tend to effect our Windows platforms more heavily but the issue occurs on our Mac nodes as well.
The failures clump on a single node for a time but they are not exclusive to any 1 node.
We've noticed that the failures happen most often with load, particularly failed sub-jobs are started later than their successful sibling sub-jobs (often after other siblings have already completed).
We suspect that the sub-jobs are somehow considered completed by the master before they actually complete. Since they're not done the master sees them as failed. Later the sub-job really does complete (thus the console output says Success). We suspect this because we've added comments to "failed" jobs which look incomplete only to return later and see additional console logs.
It turns out that there is a bug in either the Jenkins "Set Build Name" plugin or the "Configuration Matrix" plugin. When you use them both you're subject to a few bugs. First is the symptoms I described above. Second is that the names set on builds can be wrong (race conditions mean that the wrong name can be applied).
There is a ticket open against Jenkins here. Unfortunately there isn't currently a posted work-around. We may simply stop using one of the plugins.

Build-timeout Plugin in Jenkins: how long is 'too long'?

I would like to take advantage of this plug-in but the 'Abort the build if it's stuck' option doesn't set any timer and the description of the plug-in doesn't say how long is the timer, it just says: 'This plugin allows you to automatically abort a build if it's taking too long'
My question is how long is that? 1 hour, less/more?
Can I set up my own time?
Is that timer for the overall job or every line in the batch file has that timer?
Build-timeout plugin has multiple options (taken from help documentation of Build Timeout Plugin)
Absolute time. Use this if you know exactly how much time your build should not exceed in advance
Elastic time. Use this option if you want Jenkins to decide on the time. It basically averages out on the last n builds and will stop a
build if it exceeds given percentage. If you do not know in advance
how much time your build takes, use this option
Likely Stuck. Use Jenkins' Executor.html#isLikelyStuck() heuristics based approach to detect build is suspiciously taking for a long time
In your case, option two seems to be best initially.
I upgraded my jenkins installations recently to 1532 and noticed on jobs that the radio to set time has gone missing. I may file this as a bug.
This is what it should look like on your jobs:
https://github.com/jenkinsci/build-timeout-plugin/pull/14#issuecomment-24114825
I just upgraded to Jenkins 1535 and with that a new upgrade of the plug-in was available. That upgrade fixed the problem I was having. The timeout time is now available.

Sonar execution via jenkins, sonar processing continue even after ANALYSIS SUCCESSFUL message

I am facing an issue while running sonar through Jenkins, after configuration when I making build by build now trigger my build runs and creating EAR successfully then sonar deployment starts which also run successfully and showing ANALYSIS SUCCESSFUL in the end of Jenkins build processing but even after successful analysis of sonar build continue to process and it never ends even after a long time wait. Very last line of build processing is
"12:55:14.159 INFO - <- Delete aborted builds"
pls see attached screenshot to refer.
can anybody help me out over this issue?
what is the reason behind this continuous processing of sonar analysis?
it never complete. what should I do at my end to complete build process so that my build become successful in the end?
Try restarting Jenkins. It solved the issue for me.
The ANALYSIS SUCCESSFUL message just means that all sensors and decorators have completed. There are still some post-analysis tasks which must take place (specifically, any class extending PostJob). I've found that the final log output message is not always an accurate indicator of what's wrong. There are some plugins which churn forever but don't produce any output. But I wouldn't be surprised if your analyses really are stuck at "Delete aborted builds." Sometimes the Database Cleaner can take a long time, but if it's more than 10 minutes, it's stuck. It's very likely a problem with database interaction.
The way to continue is to enable all possible SQL tracing. Enable all the options -- sonar.showProfiling=true, sonar.showSql=true, sonar.showSqlResults=true, and sonar.verbose=true. See the Sonar Analysis Parameters for more information.
If that doesn't tell you what's wrong, you might have some luck getting more information out of sonar.log by editing wrapper.conf to show DEBUG log output.

Stop build execution in Jenkins

I am using Jenkins to run a Maven project having Junit tests in Sauce Connect. I created a job and to stop/abort the build in between I clicked the Cross button (X) shown near progress bar for build execution. But the build execution does not get stopped.
When I moved to console output for the build, it was showing message as "Closing Sauce Connect" and it takesd too much time and Jenkins does not stop build process.
Could anyone please advice as to how can we manually stop/abort build execution.
Additionally, is there any site where we can find proper documentation regarding Jenkins for Beginners as i have few more problems regarding its start and stop process.
I guess it is too late to answer but my help some people.
Install the monitoring plugin. (http://wiki.jenkins-ci.org/display/JENKINS/Monitoring)
Go to jenkinsUrl/monitoring/nodes
Go to the Threads section at the bottom
Click on the details buttom on the left of the slave the job is build on
Sort by User time (ms)
Then look at the name of the thread, you will have the name and number of the build
Kill it
Hope it can help
Jenkins will terminate the build nicely, i.e. wait for the running processes to end after sending the termination signal. If the processes take a long time to terminate, it will wait. The easiest way is to change your build/code such that it terminates immediately, or has a timeout for closing connections etc.
Regarding more documentation, have a look at the Jenkins wiki or get the Jenkins book.

Resources