• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      Job status is not updated in the web browser during build. The progress bar appears and the dot starts blinking, but they never move - even when the job is finished. Reloading the page shows proper status (if job is completed) or proper progress (if it is still building).

      Problem observed with latest Firefox and Chrome (other browsers not checked). Inspecting AJAX calls in browser's console reveals that AJAX requests are sent each few seconds and all get 200 OK, but the response body is empty. (On a properly working system the response body is not empty while the job is building).

      jenkins.log shows no error or exception - in fact even at log level 7, it shows nothing about the AJAX call. It just denotes at INFO level that a job is starting, then that it completes.

          [JENKINS-31487] Job status not updated in web UI during build

          Daniel Beck added a comment -

          Appears to be caused by the wrong offset sent for nextBuildNumberToFetch – the client says he's just not interested in build that already exist when the initial page was loaded.

          Noticed another problem in the process though, if no build is running when the page loads, there's never going to be AJAX updates. Not sure whether caused by my WIP or in general, but this'll take some more time.

          Daniel Beck added a comment - Appears to be caused by the wrong offset sent for nextBuildNumberToFetch – the client says he's just not interested in build that already exist when the initial page was loaded. Noticed another problem in the process though, if no build is running when the page loads, there's never going to be AJAX updates. Not sure whether caused by my WIP or in general, but this'll take some more time.

          Matthew Reiter added a comment - - edited

          I've attached a patch that works for me... I'm not sure if it's the best approach but might be a good place to start. The patch is relative to version 2.20. jobStatus.patch

          Matthew Reiter added a comment - - edited I've attached a patch that works for me... I'm not sure if it's the best approach but might be a good place to start. The patch is relative to version 2.20. jobStatus.patch

          Daniel Beck added a comment -

          matthewreiter Looks a lot like what I did locally. Same issue as mine though AFAICT, if there was no build running when the page loaded, the list is never updated. Can you confirm the same behavior?

          Daniel Beck added a comment - matthewreiter Looks a lot like what I did locally. Same issue as mine though AFAICT, if there was no build running when the page loaded, the list is never updated. Can you confirm the same behavior?

          Matthew Reiter added a comment - - edited

          danielbeck Yes, I am seeing the same behavior. I opened two browser windows pointing at the job page, kicked off the build on one window and saw that the other window didn't see the build until I refreshed the page.

          Matthew Reiter added a comment - - edited danielbeck Yes, I am seeing the same behavior. I opened two browser windows pointing at the job page, kicked off the build on one window and saw that the other window didn't see the build until I refreshed the page.

          I've updated the patch to include a fix for the list not updating if no builds were running (nextBuildNumberToFetch was null, resulting in a syntax error in the javascript code) and to make it work with concurrent builds if they finish out of order. jobStatus2.patch

          Matthew Reiter added a comment - I've updated the patch to include a fix for the list not updating if no builds were running (nextBuildNumberToFetch was null, resulting in a syntax error in the javascript code) and to make it work with concurrent builds if they finish out of order. jobStatus2.patch

          Daniel Beck added a comment -

          matthewreiter Could you submit this as a PR on GitHub?

          Daniel Beck added a comment - matthewreiter Could you submit this as a PR on GitHub?

          I've created the pull request: https://github.com/jenkinsci/jenkins/pull/2542

          Matthew Reiter added a comment - I've created the pull request: https://github.com/jenkinsci/jenkins/pull/2542

          Code changed in jenkins
          User: Matthew Reiter
          Path:
          core/src/main/java/hudson/widgets/BuildHistoryWidget.java
          core/src/main/java/hudson/widgets/HistoryWidget.java
          core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly
          http://jenkins-ci.org/commit/jenkins/0268b988d5c88cd29be12ed25e95d5bc448c2840
          Log:
          [FIXED JENKINS-31487] (#2542)

          There were two issues preventing the build history from updating properly:
          1) The next build number being fetched wasn't taking into account running builds, so any builds already running when the page is refreshed would be ignored. The fix was to use nextBuildNumberToFetch if it is available (which is the case if there are running builds) and to fall back to the next build otherwise.
          2) The first transient build key (used to clear out builds from the history that are being updated) wasn't being set when the page first loads. This was fixed by making getHistoryPageFilter calculate the value so that it happens in all cases rather than just during the ajax call.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Matthew Reiter Path: core/src/main/java/hudson/widgets/BuildHistoryWidget.java core/src/main/java/hudson/widgets/HistoryWidget.java core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly http://jenkins-ci.org/commit/jenkins/0268b988d5c88cd29be12ed25e95d5bc448c2840 Log: [FIXED JENKINS-31487] (#2542) There were two issues preventing the build history from updating properly: 1) The next build number being fetched wasn't taking into account running builds, so any builds already running when the page is refreshed would be ignored. The fix was to use nextBuildNumberToFetch if it is available (which is the case if there are running builds) and to fall back to the next build otherwise. 2) The first transient build key (used to clear out builds from the history that are being updated) wasn't being set when the page first loads. This was fixed by making getHistoryPageFilter calculate the value so that it happens in all cases rather than just during the ajax call.

          Is there any chance of getting this fix into the 1.x version?

          Kevin Mandeville added a comment - Is there any chance of getting this fix into the 1.x version?

          Daniel Beck added a comment -

          Is there any chance of getting this fix into the 1.x version?

          We are no longer maintaining any releases of the 1.x line. Regular weekly releases are at 2.25, LTS releases are at 2.19.x.

          Daniel Beck added a comment - Is there any chance of getting this fix into the 1.x version? We are no longer maintaining any releases of the 1.x line. Regular weekly releases are at 2.25, LTS releases are at 2.19.x.

            danielbeck Daniel Beck
            mistoffelees Assen Totin
            Votes:
            14 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: