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

Build timeout does not result in FAILURE or email

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • plugin-proposals
    • None
    • Platform: All, OS: All

      We installed and configured the buildtimeout plugin.

      We now found it working, our builder exceeded the time set and got aborted.

      The aborted state results in a gray icon and nothing more.

      At least I expect a mail that the build got aborted. But I think it is a failure
      of the build.
      We use this buildtimeout to prevent a hanging build. We normally have a build of
      4 minutes so I configured the buildtimeout on 10 minutes. Now due to a
      implementation issue our build exceeded the 10 and we expected it to break.

          [JENKINS-1502] Build timeout does not result in FAILURE or email

          Cees Bos added a comment -

          With a small change in hudson.tasks.MailSender this can be fixed:

          protected MimeMessage getMail(AbstractBuild build, BuildListener listener)
          throws MessagingException, InterruptedException {
          if (build.getResult() == Result.FAILURE)

          { return createFailureMail(build, listener); }

          //NEW PART FOR ABORTED
          if (build.getResult() == Result.ABORTED)

          { MimeMessage msg = createFailureMail(build, listener); msg.setSubject(getSubject(build, "Build aborted in Hudson: "),"UTF-8"); }

          if (build.getResult() == Result.UNSTABLE) {
          AbstractBuild prev = build.getPreviousBuild();
          if (!dontNotifyEveryUnstableBuild)
          return createUnstableMail(build, listener);
          if (prev != null)

          { if (prev.getResult() == Result.SUCCESS) return createUnstableMail(build, listener); }

          }

          if (build.getResult() == Result.SUCCESS) {
          B prev = build.getPreviousBuild();
          if (prev != null)

          { //ABORTED CHECK ADDED if (prev.getResult() == Result.FAILURE || prev.getResult() == Result.ABORTED) return createBackToNormalMail(build, "normal", listener); if (prev.getResult() == Result.UNSTABLE) return createBackToNormalMail(build, "stable", listener); }

          }

          return null;
          }

          IMO 'Aborted' is an exceptional state and mails should be sent on this state.

          Cees Bos added a comment - With a small change in hudson.tasks.MailSender this can be fixed: protected MimeMessage getMail(AbstractBuild build, BuildListener listener) throws MessagingException, InterruptedException { if (build.getResult() == Result.FAILURE) { return createFailureMail(build, listener); } //NEW PART FOR ABORTED if (build.getResult() == Result.ABORTED) { MimeMessage msg = createFailureMail(build, listener); msg.setSubject(getSubject(build, "Build aborted in Hudson: "),"UTF-8"); } if (build.getResult() == Result.UNSTABLE) { AbstractBuild prev = build.getPreviousBuild(); if (!dontNotifyEveryUnstableBuild) return createUnstableMail(build, listener); if (prev != null) { if (prev.getResult() == Result.SUCCESS) return createUnstableMail(build, listener); } } if (build.getResult() == Result.SUCCESS) { B prev = build.getPreviousBuild(); if (prev != null) { //ABORTED CHECK ADDED if (prev.getResult() == Result.FAILURE || prev.getResult() == Result.ABORTED) return createBackToNormalMail(build, "normal", listener); if (prev.getResult() == Result.UNSTABLE) return createBackToNormalMail(build, "stable", listener); } } return null; } IMO 'Aborted' is an exceptional state and mails should be sent on this state.

          mdonohue added a comment -

          Dup

              • This issue has been marked as a duplicate of 1288 ***

          mdonohue added a comment - Dup This issue has been marked as a duplicate of 1288 ***

            Unassigned Unassigned
            cbos Cees Bos
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: