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

perforce plugin: exception in parseDateWithTimezone

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.580.3, perforce-plugin 1.3.33
    • Similar Issues:

      Description

      This is new in 1.3.33. I have downgraded to 1.3.29 to avoid the issue on my end.

      The bug appears to be caused by the new date parsing. Intermittently, changes will throw the following exception and fail our builds:

      Caught exception communicating with perforce. Failed to retrieve changelist.
      at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:254)
      at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:69)
      at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:431)
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1073)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1257)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
      at hudson.model.Run.execute(Run.java:1745)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Caused by: java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Long.parseLong(Long.java:453)
      at java.lang.Long.parseLong(Long.java:483)
      at java.text.DigitList.getLong(DigitList.java:194)
      at java.text.DecimalFormat.parse(DecimalFormat.java:1316)
      at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2088)
      at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
      at java.text.DateFormat.parse(DateFormat.java:355)
      at com.tek42.perforce.parse.ChangelistBuilder.parseDateWithTimezone(ChangelistBuilder.java:286)
      at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:109)
      ... 11 more

        Attachments

          Issue Links

            Activity

            Hide
            ndesjardins Nicolas Desjardins added a comment -

            No, it's intermittent. It's happened several times this week (since our update to 1.33.3) out of, say, 100 runs.

            Show
            ndesjardins Nicolas Desjardins added a comment - No, it's intermittent. It's happened several times this week (since our update to 1.33.3) out of, say, 100 runs.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I attached the plugin build with the patch from https://github.com/jenkinsci/perforce-plugin/pull/68

            Show
            oleg_nenashev Oleg Nenashev added a comment - I attached the plugin build with the patch from https://github.com/jenkinsci/perforce-plugin/pull/68
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java
            http://jenkins-ci.org/commit/perforce-plugin/7dc6a9704b2c89682e767b2bc937ebe71794b7c7
            Log:
            JENKINS-26839 - Avoid the usage of static SimpleDateFormat instance

            I also changed the date parsing method visibility to implement several tests

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java http://jenkins-ci.org/commit/perforce-plugin/7dc6a9704b2c89682e767b2bc937ebe71794b7c7 Log: JENKINS-26839 - Avoid the usage of static SimpleDateFormat instance I also changed the date parsing method visibility to implement several tests Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java
            http://jenkins-ci.org/commit/perforce-plugin/fb55d0f360c85e527328c91dc2f869db90356d43
            Log:
            Merge pull request #68 from oleg-nenashev/JENKINS-26839

            JENKINS-26839 - Avoid the usage of static SimpleDateFormat instance

            Compare: https://github.com/jenkinsci/perforce-plugin/compare/7abd9ded500a...fb55d0f360c8

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java http://jenkins-ci.org/commit/perforce-plugin/fb55d0f360c85e527328c91dc2f869db90356d43 Log: Merge pull request #68 from oleg-nenashev/ JENKINS-26839 JENKINS-26839 - Avoid the usage of static SimpleDateFormat instance Compare: https://github.com/jenkinsci/perforce-plugin/compare/7abd9ded500a...fb55d0f360c8
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            1.3.34 has been released

            Show
            oleg_nenashev Oleg Nenashev added a comment - 1.3.34 has been released

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                ndesjardins Nicolas Desjardins
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: