Uploaded image for project: 'Apache Tez'
  1. Apache Tez
  2. TEZ-1278

TezClient#waitTillReady() should not swallow interrupts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.5.0
    • 0.5.0
    • None
    • None
    • Incompatible change

    Description

      Current code is:

        while (true) {
            TezAppMasterStatus status = getAppMasterStatus();
            if (status.equals(TezAppMasterStatus.SHUTDOWN)) {
              throw new SessionNotRunning("TezSession has already shutdown");
            }
            if (status.equals(TezAppMasterStatus.READY)) {
              return;
            }
            try {
              Thread.sleep(SLEEP_FOR_READY);
            } catch (InterruptedException e) {
              LOG.info("Sleep interrupted", e);
              continue;
            }
          }
      

      That way you never can stop the wait call since all interrupts are caught and the wait logic just happily proceeds.

      Suggestion: InterruptedException could be part of the method signature so the caller can handle this in a way which is adequate to the context.

      Nice read on handling interrupts: http://www.ibm.com/developerworks/library/j-jtp05236/

      Attachments

        1. TEZ-1278.1.patch
          5 kB
          Johannes Zillmann

        Issue Links

          Activity

            People

              oae Johannes Zillmann
              oae Johannes Zillmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: