Esempio n. 1
0
    @Override
    protected final void die(Throwable cause) {
      super.die(cause);
      if (ctx.channel().isOpen()) ctx.close();

      // Ensure to release server references
      userActor = null;
      ctx = null;
    }
Esempio n. 2
0
    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
      if (cause instanceof ReadTimeoutException) {
        LOG.warn(cause.getMessage(), cause);
      } else {
        LOG.error("Fetch failed :", cause);
      }

      // this fetching will be retry
      IOUtils.cleanup(LOG, fc, raf);
      finishTime = System.currentTimeMillis();
      state = TajoProtos.FetcherState.FETCH_FAILED;
      ctx.close();
    }
Esempio n. 3
0
 @Override
 public final void close() {
   if (ctx.channel().isOpen()) ctx.close();
   if (actor != null) actor.die(null);
 }
Esempio n. 4
0
 @Override
 public final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
   if (ctx.channel().isOpen()) ctx.close();
   log.error("Exception caught", cause);
 }