Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce, mail # user - JobClient methods doesn't have a timeout. --> org.apache.hadoop.ipc.Client.call(...) blocks infinate


Copy link to this message
-
JobClient methods doesn't have a timeout. --> org.apache.hadoop.ipc.Client.call(...) blocks infinate
Christian Schneider 2013-08-02, 10:42
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.