hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <cschneiderpub...@gmail.com>
Subject JobClient methods doesn't have a timeout. --> org.apache.hadoop.ipc.Client.call(...) blocks infinate
Date Fri, 02 Aug 2013 10:42:49 GMT
Hi,
it would be nice if we can specify a timeout for JobClient Calls.

If we call JobClient.getJob(...) and the connection breaks, it blocks
without getting a timeout.
This is because the org.apache.hadoop.ipc.Client.call(...) looks like this:

  public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
      ConnectionId remoteId) throws InterruptedException, IOException {
  // omitted
    boolean interrupted = false;
    synchronized (call) {
      while (!call.done) {
        try {
          // no timeout here:
          call.wait();
        } catch (InterruptedException ie) {
          // save the fact that we were interrupted
          interrupted = true;
        }
      }
  // omitted
}

Now my "business logic" will not get notified if smth. with the connection
happens.

They only way for me will be to wrap the JobClient Calls into a runnable
and interrupt the thread after some time.


Or is there another way to do it?

Best Regards,
Christian.

Mime
View raw message