Mubarak Seyed created FLUME-1289:
------------------------------------

             Summary: HDFSEventSink doesn't log exception when config points to 
incorrect NN hostname
                 Key: FLUME-1289
                 URL: https://issues.apache.org/jira/browse/FLUME-1289
             Project: Flume
          Issue Type: Bug
          Components: Sinks+Sources
            Reporter: Mubarak Seyed


It appears from test that if hdfs sink path points to incorrect {{NameNode}} 
hostname, there is no exception in log when {{BucketWriter}} append happens, 
there is no easy way to debug and correct the config file for hdfs path in hdfs 
sink.

Looks like exception is eaten somewhere. 

Do we need to catch Exception here?

{code}
 private static <T> T callWithTimeout(final ExecutorService executor,
      long timeout, final Callable<T> callable)
      throws IOException, InterruptedException {
    Future<T> future = executor.submit(callable);
    try {
      if (timeout > 0) {
        return future.get(timeout, TimeUnit.MILLISECONDS);
      } else {
        return future.get();
      }
    } catch (TimeoutException eT) {
      future.cancel(true);
      throw new IOException("Callable timed out", eT);
    } catch (ExecutionException e1) {
      Throwable cause = e1.getCause();
      if (cause instanceof IOException) {
        throw (IOException) cause;
      } else if (cause instanceof InterruptedException) {
        throw (InterruptedException) cause;
      } else if (cause instanceof RuntimeException) {
        throw (RuntimeException) cause;
      } else if (cause instanceof Error) {
        throw (Error)cause;
      } else {
        throw new RuntimeException(e1);
      }
    } catch (CancellationException ce) {
      throw new InterruptedException(
          "Blocked callable interrupted by rotation event");
    } catch (InterruptedException ex) {
      LOG.warn("Unexpected Exception " + ex.getMessage(), ex);
      throw ex;
    }
  }
{code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to