• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • build-timeout-plugin
    • None
    • Jenkins 1.596.2, Build Timeout Plugin 1.14.1

      Plugin configuration in the job:

      • Abort the build if it's stuck
      • Time-out strategy: No Activity (180 seconds)
      • Time-out actions: Fail the build
      • Post-build step: e-mail notification for each instable build

      Expected result: e-mail is sent if build is failed via time-out plugin.

      Actual result: no e-mail is sent.

      On GitHub you asked me for the config.xml. I have no idea how to get that, I am a Jenkins user with admin rights but have no access to the host on the command line.

      The end of the job output looks like this:

      Build timed out (after 3 minutes). Marking the build as failed.
      Build was aborted
      channel stopped
      Finished: FAILURE

        1. config.xml
          4 kB
        2. config.xml
          4 kB
        3. FailOperation.java
          7 kB

          [JENKINS-28125] No e-mail is sent if build is aborted

          Alexander Kriegisch added a comment - - edited

          I tried to reproduce it with a simple freestyle job, a shell script "sleep 10" and a "no activity" time-out of 3 seconds. Jenkins sends e-mails if I choose "fail the build" as action for the time-out plugin. It does not if I select "abort the build". So far, so good.

          Now back to my other job, a Maven job for a multi-module project. As I said in the ticket description, the setup is basically the same, i.e. also "fail the build". The plugin does fail the build, as can be seen in the log output. But no e-mails are sent. (BTW, if the build fails due to a broken test, i.e. without a time-out, an e-mail is sent.) This is the problem. Maybe it is specific to Maven jobs if it does not happen for my freestyle dummy job. But this is just an educated guess.

          Alexander Kriegisch added a comment - - edited I tried to reproduce it with a simple freestyle job, a shell script "sleep 10" and a "no activity" time-out of 3 seconds. Jenkins sends e-mails if I choose "fail the build" as action for the time-out plugin. It does not if I select "abort the build". So far, so good. Now back to my other job, a Maven job for a multi-module project. As I said in the ticket description, the setup is basically the same, i.e. also "fail the build". The plugin does fail the build, as can be seen in the log output. But no e-mails are sent. (BTW, if the build fails due to a broken test, i.e. without a time-out, an e-mail is sent.) This is the problem. Maybe it is specific to Maven jobs if it does not happen for my freestyle dummy job. But this is just an educated guess.

          ikedam added a comment -

          Let me see.
          You can't use E-mail Notification in Post-build actions with maven project.
          Instead, you have E-mail Notification in Build Settings, right?
          It may behave in the way different from that of free-style projects.

          You may try Email-ext plugin, which should behave as free-style projects.

          You can get config.xml with http://(jenkins-base-uri)/job/(project name)/config.xml.

          ikedam added a comment - Let me see. You can't use E-mail Notification in Post-build actions with maven project. Instead, you have E-mail Notification in Build Settings, right? It may behave in the way different from that of free-style projects. You may try Email-ext plugin , which should behave as free-style projects. You can get config.xml with http://(jenkins-base-uri)/job/(project name)/config.xml.

          ikedam added a comment -

          That reproduced in my environment.

          A MavenModuleSetBuild doesn't update its result from "aborted" to "failure" till the build completes.
          This prevents E-mail Notification sending a mail, as the result isn't failure at that time.

          Please try email-ext plugin, which allows you configure to send a mail also for aborted builds.

          ikedam added a comment - That reproduced in my environment. A MavenModuleSetBuild doesn't update its result from "aborted" to "failure" till the build completes. This prevents E-mail Notification sending a mail, as the result isn't failure at that time. Please try email-ext plugin, which allows you configure to send a mail also for aborted builds.

          The config.xml (sensitive data x-ed out) you requested

          Alexander Kriegisch added a comment - The config.xml (sensitive data x-ed out) you requested

          @ikedam: I am just clarifying if it is okay for our admin to install E-mail-ext.

          What do you suggest concerning this problem with the Maven plugin? Should I file a request to the maintainer? Or is it rather a core e-mail problem? I am unsure where to address this problem, I just know that I strongly prefer fixes to work-arounds.

          Alexander Kriegisch added a comment - @ikedam: I am just clarifying if it is okay for our admin to install E-mail-ext. What do you suggest concerning this problem with the Maven plugin? Should I file a request to the maintainer? Or is it rather a core e-mail problem? I am unsure where to address this problem, I just know that I strongly prefer fixes to work-arounds.

          ikedam added a comment -

          > A MavenModuleSetBuild doesn't update its result from "aborted" to "failure" till the build completes.

          I found that the build result isn't updated even after the build completes.
          This happens in the following way:

          • The result of the MavenModuleSetBuild gets the worst one of the internal result of the MavenModuleSetBuild (this is set to "failure" by build-tiemout plugin) and the results of build of its modules (this is set to "aborted" and not set to "failure" by build-timeout plugin as build-timeout plugin doesn't know about modules).
          • "aborted" is worse than "failure". In Jenkins, build results are treated as SUCCESS > UNSTABLE > FAILURE > NOT_BUILT > ABORTED.

          > What do you suggest concerning this problem with the Maven plugin?

          Sorry, but I don't know... That's a really complicated problem.

          • You may request the fix to the maintainer of maven-plugin. Though, it might be not considered as a bug as maven-plugin looks work in a reasonable way as described above.
          • You may request an option to send a mail even for aborted builds to mailer-plugin.
          • There looks nothing build-timeout plugin can do though I have further investigation.

          ikedam added a comment - > A MavenModuleSetBuild doesn't update its result from "aborted" to "failure" till the build completes. I found that the build result isn't updated even after the build completes. This happens in the following way: The result of the MavenModuleSetBuild gets the worst one of the internal result of the MavenModuleSetBuild (this is set to "failure" by build-tiemout plugin) and the results of build of its modules (this is set to "aborted" and not set to "failure" by build-timeout plugin as build-timeout plugin doesn't know about modules). "aborted" is worse than "failure". In Jenkins, build results are treated as SUCCESS > UNSTABLE > FAILURE > NOT_BUILT > ABORTED. > What do you suggest concerning this problem with the Maven plugin? Sorry, but I don't know... That's a really complicated problem. You may request the fix to the maintainer of maven-plugin. Though, it might be not considered as a bug as maven-plugin looks work in a reasonable way as described above. You may request an option to send a mail even for aborted builds to mailer-plugin. There looks nothing build-timeout plugin can do though I have further investigation.

          ikedam added a comment -

          Build-timeout plugin stops a build and sets its result to FAILURE using Jenkins core API.
          http://javadoc.jenkins-ci.org/hudson/model/Executor.html#interrupt(hudson.model.Result)

          It can be a problem of maven-plugin that a build result gets ABORTED even when it is interrupted with Executor#interrupt(FAILURE).
          You may file an issue for that.

          ikedam added a comment - Build-timeout plugin stops a build and sets its result to FAILURE using Jenkins core API. http://javadoc.jenkins-ci.org/hudson/model/Executor.html#interrupt(hudson.model.Result ) It can be a problem of maven-plugin that a build result gets ABORTED even when it is interrupted with Executor#interrupt(FAILURE) . You may file an issue for that.

          ikedam added a comment -

          It is considered as an issue of maven-plugin.

          ikedam added a comment - It is considered as an issue of maven-plugin.

          jchatham added a comment -

          I recently encountered this issue (as well as JENKINS-26048), and was able to put together a fix that worked for me. FailOperation.java

          Yes, I know, the actual bug(s) are over in the maven plugin - but I wasn't able to figure out how to fix them there. Hopefully this code will be of use to someone else.

          jchatham added a comment - I recently encountered this issue (as well as JENKINS-26048 ), and was able to put together a fix that worked for me. FailOperation.java Yes, I know, the actual bug(s) are over in the maven plugin - but I wasn't able to figure out how to fix them there. Hopefully this code will be of use to someone else.

            kohsuke Kohsuke Kawaguchi
            kriegaex Alexander Kriegisch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: