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

Don't fail the job if setting the GitHub status fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • github-plugin
    • None

      If setting the commit status fails, for example because of a timeout, an exception is thrown and the job is marked as failed, which I think is not a reasonable option, as there is nothing wrong with the build itself.

      It would be better to just report the problem in some way but keep the job status intact.

      Example:

      Setting commit status on GitHub for https://github.com/some/repo/commit/7304040cd2d63d15cbe922e23fd6dac7ad86bca8
      ERROR: Step ‘Set build status on GitHub commit’ aborted due to exception: 
      java.net.SocketTimeoutException: timeout
      	at okio.Okio$3.newTimeoutException(Okio.java:207)
      	at okio.AsyncTimeout.exit(AsyncTimeout.java:261)
      	at okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
      	at okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
      	at okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
      	at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
      	at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
      	at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
      	at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:906)
      	at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:782)
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:444)
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:389)
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:502)
      	at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
      	at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
      	at org.kohsuke.github.Requester.parse(Requester.java:479)
      	at org.kohsuke.github.Requester._to(Requester.java:236)
      	at org.kohsuke.github.Requester.to(Requester.java:203)
      	at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:854)
      	at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:142)
      	at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:111)
      	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      	at hudson.model.Run.execute(Run.java:1763)
      	at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      Caused by: java.net.SocketException: Socket closed
      	at java.net.SocketInputStream.read(SocketInputStream.java:190)
      	at java.net.SocketInputStream.read(SocketInputStream.java:122)
      	at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
      	at sun.security.ssl.InputRecord.read(InputRecord.java:480)
      	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
      	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:903)
      	at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
      	at okio.Okio$2.read(Okio.java:139)
      	at okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
      	... 28 more
      Finished: FAILURE
      

            lanwen Kirill Merkushev
            lucasocio Leandro Lucarella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: