3

It turns out my question were way too specific to be useful for anyone in the future. Therefore the question is rephrased as:

Debugging what happens when a Jenkins build unexpectedly pauses or hangs.

An answer will also be added.


The original question and description follows:

Debugging what happens between the Build and Post-Build Action sections

In the last week or so, we have experienced delays in our build-jobs. Debugging indicated that the delay (between 10 and 15 minutes) is introduced in the space between the Build and Post-Build Action of a freestyle project.

In an attempt to debug, I've set up a job with one Windows batch action, to echo a line in the Build section, and a groovy postbuild in the Post-Build section.

The batch is simply: echo Last entry in the Build Actions.
The groovy similar simple: manager.listener.logger.println("First entry in Post-build Actions");

The log (with timestamps) generates this:

15:12:05 Last entry in the Build Actions.
15:26:08 First entry in Post-build Actions

I've been traversing the Jenkins logs, but my search for a smoking gun has come up empty.

How can I monitor what happens between the two states?

fsteff
  • 169

1 Answers1

1

Debugging Jenkins isn't particular easy.

In this case, the best option turned out to be creating a snapshot stack-trace. This can be performed via the WEB UI, by accessing http://your.jenkins.server/threadDump.

.. Then it's "just" a matter of spotting anything not normal in the 6000++ lines of generated stacktrace.

On the following page, the Jenkins community have documented some further ways to perform this sort of debugging: https://wiki.jenkins.io/display/JENKINS/Obtaining+a+thread+dump

fsteff
  • 169