void resolveVersion(Duration timeout, VersionHandler handler) {
        boolean hasVersion = false;
        boolean shouldInvoke = false;
        boolean shouldLog = log.isLoggable(Level.FINE);
        synchronized (this) {
            if (version != null) {
                if (shouldLog) {
                    log.log(Level.FINE, "Version already available for target '" + name + "' (version " + version + ").");
                }
                hasVersion = true;
            } else {
                if (shouldLog) {
                    log.log(Level.FINE, "Registering version handler '" + handler + "' for target '" + name + "'.");
                }
                versionHandlers.add(handler);
                if (!targetInvoked) {
                    targetInvoked = true;
                    shouldInvoke = true;
                }
            }
        }
        if (hasVersion) {
            handler.handleVersion(version);
        } else if (shouldInvoke) {
            if (shouldLog) {
                log.log(Level.FINE, "Invoking mbus.getVersion() on target '" + name + "'");
            }
            Request req = new Request("mbus.getVersion");
            target.invokeAsync(req, timeout, this);
        }
    }
<p>Requests the version of this target be passed to the given {@link
VersionHandler}. If the version is available, the handler is called
synchronously; if not, the handler is called by the network thread once
the target responds to the version query.</p>

@param timeout The timeout for the request in seconds.
@param handler The handler to be called once the version is available.
messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCTarget.java