Why can't my pipeline task be completed?

I’m encountering an intermittent issue where a pipeline passes all stages successfully but hangs indefinitely at the final step:

end of pipeline


Normally, this message should immediately be followed by Finished: SUCCESS, but in these cases, the pipeline appears to freeze. Notably:

  1. The build page already shows SUCCESS status (despite the hang), leaving no option to terminate/kill the job—only “Delete” is available.
  2. After deleting one such build, I’m unsure whether pipeline resources (e.g., executors, temp files) were fully released, raising concerns about hidden resource leaks.

Steps to Reproduce (Low Probability):

  • Run pipelines repeatedly; issue occurs sporadically (~1/500 runs).
  • No clear pattern—fails randomly after all steps pass.

Expected Behavior:
After end of pipeline, Jenkins should:

  • Print Finished: SUCCESS promptly.
  • Fully release resources upon build completion/deletion.