private static void withExceptionHandling(Request req, ThrowingRunnable runnable) {
        try {
            TimeTracker timeTracker = new TimeTracker(req);
            runnable.run();
            timeTracker.logSpentTime();
        } catch (Exception e) {
            log.log(WARNING, "Got exception when running RPC command " + req.methodName(), e);
            setMethodFailedError(req, e);
        } catch (Error e) {
            log.log(WARNING, "Got error when running RPC command " + req.methodName(), e);
            setMethodFailedError(req, e);
        } catch (Throwable t) {
            log.log(WARNING, "Got throwable (non-error, non-exception) when running RPC command " + req.methodName(), t);
            setMethodFailedError(req, t);
        }
    }
Rpc server for the metrics proxy.

When a new object is created after reconfiguration, it will claim ownership of the methods
in the given {@link RpcConnector}. This is ok because at the time this component is created,
all components it depends on are already created.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/rpc/RpcServer.java