Unverified Commit 66764e5a authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Cleanup config rpc

parent b3c4286b
Loading
Loading
Loading
Loading
+48 −44
Original line number Diff line number Diff line
@@ -77,11 +77,21 @@ bool ipc_send_get_fs_config() {
            break;
        }
    }
    if (send_ret == HG_SUCCESS) {
    if (send_ret != HG_SUCCESS) {
        CTX->log()->warn("{}() timed out", __func__);
        margo_destroy(handle);
        return false;
    }

    /* decode response */
    CTX->log()->debug("{}() Waiting for response", __func__);
    ret = margo_get_output(handle, &out);
        if (ret == HG_SUCCESS) {
    if (ret != HG_SUCCESS) {
        CTX->log()->error("{}() Retrieving fs configurations from daemon", __func__);
        margo_destroy(handle);
        return false;
    }

    if (!CTX->mountdir().empty() && CTX->mountdir() != out.mountdir) {
        CTX->log()->warn(
                "{}() fs_conf mountdir {} and received out.mountdir {} mismatch detected! Using received mountdir",
@@ -113,16 +123,10 @@ bool ipc_send_get_fs_config() {
    }
    CTX->fs_conf()->hosts = hostmap;
    CTX->log()->debug("{}() Got response with mountdir {}", __func__, out.mountdir);
        } else {
            CTX->log()->error("{}() Retrieving fs configurations from daemon", __func__);
        }

    /* clean up resources consumed by this rpc */
    margo_addr_free(ld_margo_rpc_id, local_addr);
    margo_free_output(handle, &out);
    } else {
        CTX->log()->warn("{}() timed out", __func__);
    }

    margo_destroy(handle);
    return ret == HG_SUCCESS;
    return true;
}
 No newline at end of file