/** * Sleeps for retrySleepMs_ and reconnects to the worker. Returns * true if the connection was established. * TODO: why does this behave so differently than the Planner implementation. */ private boolean waitAndReconnect() { sleepForRetry(); try { protocol_.getTransport().open(); TSocket socket = ThriftUtils.getSocketTransport(protocol_.getTransport()); socket.setTimeout(connectionTimeoutMs_); workerClient_ = new RecordServiceWorker.Client(protocol_); socket.setTimeout(rpcTimeoutMs_); return true; } catch (TTransportException e) { return false; } }
switch (e.code) { case SERVICE_BUSY: sleepForRetry(); continue; default: