code: public void close() {
      clientLock.writeLock().lock();
      try {
        if (client != null) {
          RPC.stopProxy(client);
          client = null;
        }
      } finally {
        clientLock.writeLock().unlock();
      }
    }
docs: Stop RPC client.