Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple calls to fablib.get_slice(name) in the same interpreter yield different objects #379

Open
nbastin opened this issue Sep 24, 2024 · 2 comments · May be fixed by #383
Open

Multiple calls to fablib.get_slice(name) in the same interpreter yield different objects #379

nbastin opened this issue Sep 24, 2024 · 2 comments · May be fixed by #383
Assignees

Comments

@nbastin
Copy link

nbastin commented Sep 24, 2024

I'm not sure this is an intentional design choice, but it does create a bunch of problems for tools because then all downstream objects are also unique (leading to Node objects - and probably a lot of other objects - from multiple instances of the same slice being unique objects that don't share identity).

@kthare10
Copy link
Collaborator

This is intentional. Each call to get_slice triggers a fresh query to the Control Framework's Graph Model (i.e., the orchestrator). A new slice object is created with the updated graph model in Fablib.

Fablib relies on the Control Framework for the source of truth and does not persist objects. Hope this helps clarify!

@nbastin
Copy link
Author

nbastin commented Sep 25, 2024

The problem is that in the cases I'm referring to, the old object still exists. So now I can have two objects (or more) with inconsistent state (which thus breaks the idea that the CF is the source of truth). At the very least it would be nice if get_slice referenced a dictionary of weakrefs, so that you would hold the slice object you gave to a caller for as long as the caller does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants