Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14899

consoleText stops updating at 5000 lines until end of build job

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

      I found that the consoleText stops updating once a build command's output reaches 5000 lines. It doesn't update until the end of the build job, and then the rest of the lines are updated in consoleText. The consoleFull continues to update as expected, beyond the 5000 lines, even as the consoleText is not being updated.

      I have a client process which monitors the output of consoleText for changes on a build job. It stops updating at 5000 lines, then when the job completes, the rest of the build output can be found in consoleText. This gives the appearance of a stalled build job.

          [JENKINS-14899] consoleText stops updating at 5000 lines until end of build job

          David Baird added a comment -

          According to http://stackoverflow.com/questions/13388217/jenkins-plain-text-console-output-not-in-real-time: "That is because output is truncated by default around 5k lines, so the full text will always pull the last 5k while the build is in progress, similar to the way the HTML view will only show about 5k lines until you click the "Show Full Output" button.

          Once the build completes, the full output gets dumped to plain text, so the entire output is shown"

          Please add a feature to pull the last 5k, not always show the first 5k.

          David Baird added a comment - According to http://stackoverflow.com/questions/13388217/jenkins-plain-text-console-output-not-in-real-time: "That is because output is truncated by default around 5k lines, so the full text will always pull the last 5k while the build is in progress, similar to the way the HTML view will only show about 5k lines until you click the "Show Full Output" button. Once the build completes, the full output gets dumped to plain text, so the entire output is shown" Please add a feature to pull the last 5k, not always show the first 5k.

          Ben Nied added a comment -

          Is there currently any way around this limit that doesn't require scraping the HTML view?

          Ben Nied added a comment - Is there currently any way around this limit that doesn't require scraping the HTML view?

          Daniel Beck added a comment -

          Daniel Beck added a comment - Source of this issue: https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java#L547

          David Baird added a comment - - edited

          My current solution in Python is something like...
          {{
          while True:
          try:
          page = readpage(text_url, data='start=%s' % text_offset)
          except:
          sys.stderr.write('\nStopping build')
          readpage(build_url + '/stop')
          raise
          time.sleep(0.1)
          if page['error'] in _HTTP_ERROR_IGNORE_LIST:
          continue
          if page['text']:
          sys.stdout.write(page['text'])
          text_offset = page['header'].get('x-text-size')
          if text_offset and 'true' != page['header'].get('x-more-data'):
          break
          }}

          David Baird added a comment - - edited My current solution in Python is something like... {{ while True: try: page = readpage(text_url, data='start=%s' % text_offset) except: sys.stderr.write('\nStopping build') readpage(build_url + '/stop') raise time.sleep(0.1) if page ['error'] in _HTTP_ERROR_IGNORE_LIST: continue if page ['text'] : sys.stdout.write(page ['text'] ) text_offset = page ['header'] .get('x-text-size') if text_offset and 'true' != page ['header'] .get('x-more-data'): break }}

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/Run.java
          http://jenkins-ci.org/commit/jenkins/20bd4e304976dc64fa6abc165823425ba524ccb2
          Log:
          [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/Run.java http://jenkins-ci.org/commit/jenkins/20bd4e304976dc64fa6abc165823425ba524ccb2 Log: [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/Run.java
          http://jenkins-ci.org/commit/jenkins/ad7cba99d7eef6e2849baeed427a452b8ba874bd
          Log:
          Merge pull request #1733 from daniel-beck/JENKINS-14899

          [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText

          Compare: https://github.com/jenkinsci/jenkins/compare/9b7d8e9f8a96...ad7cba99d7ee

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/Run.java http://jenkins-ci.org/commit/jenkins/ad7cba99d7eef6e2849baeed427a452b8ba874bd Log: Merge pull request #1733 from daniel-beck/ JENKINS-14899 [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText Compare: https://github.com/jenkinsci/jenkins/compare/9b7d8e9f8a96...ad7cba99d7ee

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4175

          Result = SUCCESS

          dogfood added a comment - Integrated in jenkins_main_trunk #4175 Result = SUCCESS

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/Run.java
          http://jenkins-ci.org/commit/jenkins/c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c
          Log:
          [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText

          (cherry picked from commit 20bd4e304976dc64fa6abc165823425ba524ccb2)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/Run.java http://jenkins-ci.org/commit/jenkins/c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c Log: [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText (cherry picked from commit 20bd4e304976dc64fa6abc165823425ba524ccb2)

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4292
          [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText (Revision c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c)

          Result = UNSTABLE
          ogondza : c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c
          Files :

          • core/src/main/java/hudson/model/Run.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4292 [FIX JENKINS-14899] Don't use truncating LargeText for /consoleText (Revision c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c) Result = UNSTABLE ogondza : c3dcaeb8d55fe8a8065fb60cecef23d23eb9b87c Files : core/src/main/java/hudson/model/Run.java

            danielbeck Daniel Beck
            davidlbaird David Baird
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: