Giter VIP home page Giter VIP logo

Comments (2)

grondo avatar grondo commented on September 9, 2024

Ah, this is likely the problem:

if (!(c = get_attr_cache (h)))
return NULL;
/* The attribute parent-uri is treated specifically here, since
* a process connected to this instance via flux-proxy(1) should
* have the parent-uri returned as a usable remote URI.
*
* Therefore, if FLUX_PROXY_REMOTE is set in the current environment,
* and the attribute is parent-uri, instead actually return the
* handle-specific parent-remote-uri attribute. If this is not yet
* available, fetch parent-uri and construct the remote uri by
* substituting FLUX_PROXY_REMOTE in an ssh:// uri.
*/
if (streq (name, "parent-uri")
&& (proxy_remote = getenv ("FLUX_PROXY_REMOTE"))) {
orig_name = name;
name = "parent-remote-uri";
}
if ((val = zhashx_lookup (c->cache, name)))
return val;
if (!(f = flux_rpc_pack (h,
"attr.get",
FLUX_NODEID_ANY,
0,
"{s:s}",
"name", orig_name)))
return NULL;
if (flux_rpc_get_unpack (f,
"{s:s s:i}",
"value", &val,
"flags", &flags) < 0)
goto done;
/* If proxy_remote is non-NULL then parent-uri has been aliased to
* parent-remote-uri. Swap a local URI to a remote:
*/
if (proxy_remote
&& strstarts (val, "local://")) {
if (asprintf (&cpy, "ssh://%s%s", proxy_remote, val+8) < 0)
goto done;
}
else if (!(cpy = strdup (val)))
goto done;

when the parent-uri attribute is fetched, flux_attr_get(3) checks for an environment variable set by flux-proxy and attempts to instead provide a remote uri. However, the name parent-uri is updated to parent-remote-uri before checking the cache, so if parent-remote-uri is not already cached, then this call always results in an RPC, even if parent-uri is cached.

This breaks the assumption in broker/module.c attr_cache_to_json() that all attrs returned by flux_attr_cache_first() and flux_attr_cache_next() will not result in an RPC.

Additionally, even if we fixed the cache check to avoid the RPC, the wrong value for parent-uri would be set in the json representation of the cache passed to the module since it will have been translated to a remote URI.

Probably the right solution for now is to just unset FLUX_PROXY_REMOTE in the broker (along with FLUX_URI), since once another broker is started, the broker and its descendants are no longer under the influence of a remote flux proxy. However, probably the cache check noted above should also be fixed, and maybe the whole way the uri is auto-translated to its remote equivalent should have another think...

from flux-core.

grondo avatar grondo commented on September 9, 2024

I did verify that unsetenv ("FLUX_PROXY_REMOTE"); early in the broker avoids this issue.

from flux-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.