title: Calling build.doStop() in prebuild is not stopping fast enough
body: <p>I am trying to write a Jenkins plugin that can automatically abort a build if that build is triggered on a holiday (or just a given input day/s). The user can configure the days, and each job gets a checkbox that allows the user to decide if they want their job aborted on a holiday or not. Currently my plugin extends <strong>JobProperty</strong> and utilizes global configuration where I have a list of blacklisted dates. If today is on my list of blacklisted days, then I do not want my job to run.  The plugin "works" but with a few annoying caveats.</p>
  
  <p>My main issue is that I can only FAIL the build if it happens to be triggered on a day that's one of my blacklisted days.  This is a problem for me because there's no actual error. The job is operating as it should be and I don't want to receive emails full of errors just because the job was halted on a day I didn't want it to run (e.g: a holiday)</p>
  
  <p>When my plugin decides to abort a build, I want to be able to end the job with an "Aborted" status.  (In fact - I'd like to be able to control the status and leave it as a potential parameter.)</p>
  
  <p>Below is my prebuild() code.</p>
  
  <pre><code>@Override
  public boolean prebuild(AbstractBuild build, BuildListener listener) {
      boolean stopped = false;
      if(checkIfClosed) {
          LocalDate today = LocalDate.now();
          listener.getLogger().println("Checking the date for " + DateFormats.yyyyMMdd.print(today));
          if (getDescriptor().getUseCalculatedDateChecker()) {
              if (!NyseHolidayChecker.isMarketOpen(today)) {
                  listener.getLogger().println("Closed (From auto calculation)!");
                  stopped = true;
              }
          }
          if (getDescriptor().getListOfClosedDates() != null &amp;&amp; !getDescriptor().getListOfClosedDates().isEmpty()) {
              if (getDescriptor().getListOfClosedDates().contains(DateFormats.yyyyMMdd.print(today))) {
                  listener.getLogger().println("Closed. Date is in the Closed Date List. " +
                          "If this is wrong check global configuration.");
                  stopped = true;
              }
          }
      }
      if(stopped) {
          try {
              if(build.doStop() == null) {
                  return false;
              }
          } catch (IOException e) {
              listener.getLogger().println(e.getMessage());
              return false;
          } catch (ServletException e) {
              listener.getLogger().println(e.getMessage());
              return false;
          }
          //throw new RuntimeException("This job has been told not to run when marked as Closed!");
          //throw new AbortException("This job has been told not to run when marked as Closed!");
      }
      return true;
  }
  </code></pre>
  
  <p>I've tried several different ways to get the job to abort immediately and not have the build marked as failed.</p>
  
  <ol>
  <li><p>The <a href="http://javadoc.jenkins-ci.org/hudson/model/JobProperty.html#prebuild(hudson.model.AbstractBuild,%20hudson.model.BuildListener)" rel="nofollow">doc</a> tells me that I should throw an AbortException but that does not appear to be supported by the function I'm overriding. </p></li>
  <li><p>I also tried to call doStop() but then my first build step (out of 2) still runs at least a little. This isn't desirable because I will never know what state my job will be in when it will be aborted (it could have already sshed somewhere and killed a process...or made something live etc)</p></li>
  </ol>
  
  <p>What am I missing? I feel like I'm hacking around to get what I need.  I am hoping someone can point me in the right direction on how to best do this.</p>