Recurse down the exception loop looking for any inner details about an
interrupted exception.

@param thrown exception thrown
@return true if down the execution chain the operation was an interrupt
331104
static boolean containsInterruptedException(Throwable thrown) {
    if (thrown == null) {
      return false;
    }
    if (thrown instanceof InterruptedException || thrown instanceof InterruptedIOException) {
      return true;
    }
    // tail recurse
    return containsInterruptedException(thrown.getCause());
  }
1974
public static void interruptedException(String msg, InterruptedException e)
      throws IOException {
    Thread.currentThread().interrupt();
    LOG.error(msg, e);
    throw new IOException(msg, e);
  }
396728
@Private
  @Override
  public void threwException(final int taskletId, final Exception exception) {
    try {
      failedTasklets(exception, Collections.singletonList(taskletId));
    } catch (final InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
118172
private boolean mainLoop()
        throws InterruptedException
    {
        long now = System.currentTimeMillis();
        Iterator list = m_hardStore.values().iterator();
        while( list.hasNext() )
        {
            Entry entry = (Entry) list.next();
            if( entry.m_collectTime < now )
            {
                m_weakStore.put( entry.m_connection, DUMMY );
                list.remove();
            }
        }
        if( m_hardStore.size() == 0 )
        {
            m_thread = null;    // mark to start a new thread next time.
            return true;
        }
        wait( 10000 );
        return false;
    }
1276814
public boolean isCancelled() {
    Object r;
    return ((r = result) instanceof AltResult)
        && (((AltResult) r).ex instanceof CancellationException);
  }
503159
private boolean waitForTasksToFinish() throws Exception {
        
        Boolean succeeded = true;
        
        // Tracking state for multiple exceptions, if any
        List<StackTraceElement> stackTraces = new ArrayList<StackTraceElement>();
        StringBuilder sb = new StringBuilder();
        int exCount = 0;
        
        for (Future<Boolean> future : futures) {
            try {
                if (!future.get()) {
                    cancel();
                    succeeded = false;
                }
            }
            catch (Exception e) {
                error.compareAndSet(null, e);
                cancel();
                succeeded = false;
                
                exCount++;
                sb.append("ex" + exCount + ": ").append(e.getMessage()).append("\n");
                StackTraceElement[] stackTrace = e.getStackTrace();
                if (stackTrace != null && stackTrace.length > 0) {
                    StackTraceElement delimiterSE = new StackTraceElement("StackTrace: ex" + exCount, "", "", 0);
                    stackTraces.add(delimiterSE);
                    for (StackTraceElement se : stackTrace) {
                        stackTraces.add(se);
                    }
                }
            }
        }
        
        if (this.rowFunction instanceof Flushable) {
            ((Flushable)rowFunction).flush();
        }
        
        if (exCount > 0) {
            String exMessage = sb.toString();
            StackTraceElement[] seArray = stackTraces.toArray(new StackTraceElement[stackTraces.size()]);
            Exception ex = new Exception(exMessage);
            ex.setStackTrace(seArray);
            throw ex;
        }
        return succeeded;
    }
151745
public void onFailure() throws InterruptedException {
        int val = currentFailureCount.incrementAndGet();
        if (val > 50) {
            currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
            val = MAX_FAILURE_COUNT;
        }

        int delay = MIN_DELAY + ((MAX_DELAY - MIN_DELAY) / MAX_FAILURE_COUNT) * val;

        synchronized (this) {
            Logger.d(TAG, "onFailure: wait " + delay + " ms");
            wait(delay);
        }
    }
1047770
public boolean isCountedDown() throws InterruptedException, KeeperException {
        if (countedDown) return true;
        int count = ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt();
        if (count > 0) return false;
        countedDown = true;
        return true;
    }
1130205
private final static boolean pstRecursesOnNested(Throwable t) {
        //This method added for D200273

        // the following Throwables don't print out the nested throwable when printStackTrace is called
        Class cName = t.getClass();
        if (cName.getName() != null && cName.getName().equals("org.omg.CORBA.portable.UnknownException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.mail.MessagingException"))
            return false;
        if (t instanceof org.xml.sax.SAXException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.jsp.JspException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.ServletException"))
            return false;
        if (t instanceof javax.naming.NamingException)
            return false;
        if (t instanceof java.sql.SQLException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.jms.JMSException"))
            return false;

        return true;
    }
843123
private void handleInterruptedException(String message, InterruptedException cause) {
        Thread.currentThread().interrupt();
        throw new AbortedException(message, cause);
    }
349605
void handleLoopException(Throwable t) {
        logger.warn("Unexpected exception in the selector loop.", t);

        // Prevent possible consecutive immediate failures that lead to
        // excessive CPU consumption.
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            // Ignore.
        }
    }
748599
public T take() throws InterruptedException {
        lock.lock();
        try {
            while(count == 0)
                not_empty.await();
            T el=buf[ri];
            buf[ri]=null;
            if(++ri == buf.length)
                ri=0;
            count--;
            not_full.signal();
            return el;
        }
        finally {
            lock.unlock();
        }
    }
168048
private synchronized boolean shouldRetry(Throwable e) {
    boolean isIOException = e instanceof IOException
      || (e.getCause() != null && e.getCause() instanceof IOException);
    boolean hasRemainingRetries = retryCount < maxRetries;
    return isIOException && hasRemainingRetries;
  }
792748
public boolean checkCondition() {
        long timeElapsed = System.currentTimeMillis() - start.get();
        if (timeElapsed > this.timeout.get()) {

            if (LOG.isDebugEnabled()) {
                //LOG.info("Current Thread="+Thread.currentThread()+" Condition="+this+" Checkpoint "+ System.currentTimeMillis() +" timeout="+(System.currentTimeMillis() - start));
                String logString = " violated at " + System.currentTimeMillis() +
                        " (elapsed time=" + timeElapsed + ")";
                LOG.debug(new CheckConditionFailedLog(this, logString).toString());
            }
            return false;
        }
        return true;
    }
20099
private int onException(Exception e) throws IOException {
        eofReached = true;
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        } else {
            // Impossible since InputStream throws no other checked exceptions.
            throw Throwables.failure(e);
        }
    }
210525
public boolean throwIOEForInboundConnections() {
        //If the httpOption throwIOEForInboundConnections is defined, return that value
        if (this.throwIOEForInboundConnections != null)
            return this.throwIOEForInboundConnections; //PI57542

        //Otherwise, verify if a declarative service has been set to dictate the behavior
        //for this property. If not, return false.
        Boolean IOEForInboundConnectionsBehavior = HttpDispatcher.useIOEForInboundConnectionsBehavior();

        return ((IOEForInboundConnectionsBehavior != null) ? IOEForInboundConnectionsBehavior : Boolean.FALSE);

    }
45340
private static boolean isAdaptiveException(Throwable t) {
        if (t instanceof FrameTooLongException) {
            return true;
        }

        if (t instanceof NoHostAvailableException) {
            // If the issue on every host is adaptive then the exception is adaptive
            Collection<Throwable> hostExceptions = ((NoHostAvailableException) t).getErrors().values();
            return !hostExceptions.isEmpty() && hostExceptions.stream().allMatch(AdaptiveResultSet::isAdaptiveException);
        }

        return false;
    }