Skip to main content
In this tutorial, we’ll demonstrate how a Jenkins controller failure affects a long-running Freestyle project. You will learn how to: By the end, you’ll understand why Freestyle jobs do not survive controller restarts and what alternatives exist.

1. Prepare a Long-Running Deploy Job

Edit the ascii-deploy-job and insert a sleep before the actual deployment steps. This will simulate a long-running process.
Adjust the sleep duration to suit your testing environment.
Save and apply the job configuration in Jenkins.

2. Trigger the Build and Test Jobs

  1. In Jenkins, click Build Now for ascii-build-job.
  2. ascii-build-job will automatically trigger ascii-test-job.

Test Job Failure

Because our advice quote has five words or fewer, the test script will fail. Inspect ascii-test-job’s console output:
Because the test failed, ascii-deploy-job will not run.

3. Rerun and Deploy

  1. Update the advice text so it contains more than five words.
  2. Trigger ascii-build-job again.
This time:
  • ascii-test-job completes successfully.
  • ascii-deploy-job enters the queue and then starts.
Check ascii-deploy-job’s console to confirm the sleep invocation:

4. Simulate Controller Failure

While ascii-deploy-job is sleeping, simulate a controller outage.
Stopping the Jenkins controller will immediately terminate all running Freestyle jobs.
  1. SSH into the Jenkins controller host.
  2. Stop Jenkins:
    The service should display inactive.
  3. Refresh the Jenkins UI— it will be unreachable.
  4. Start Jenkins again:
    You should see output similar to:
  5. Log back into the UI and open ascii-deploy-job. The build will have failed:

5. Observations

When the Jenkins controller goes down:
  • Any running Freestyle jobs are terminated.
  • Builds do not resume after restart.
Freestyle projects cannot resume after a controller restart. Consider using Pipeline projects for better resilience and survivability.

6. Jenkins Dashboard and Icon Legend

On the Jenkins dashboard, monitor your jobs’ statuses:
The image shows a Jenkins dashboard displaying build jobs with their statuses, last success and failure times, and durations. The interface includes options for managing builds and viewing build history.
To interpret the status icons (sun, cloud, etc.), click More Actions → Icon legend:
The image shows a Jenkins dashboard with an "Icon legend" pop-up explaining the meanings of various build status icons, such as successful, failed, and in progress.

Next Steps

References

Watch Video