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

Instance status and state().status out of sync #547

Open
Hook25 opened this issue Jun 9, 2023 · 0 comments
Open

Instance status and state().status out of sync #547

Hook25 opened this issue Jun 9, 2023 · 0 comments

Comments

@Hook25
Copy link

Hook25 commented Jun 9, 2023

It seems that sometimes the instance.status and instance.state().status attributes are out of sync. I have debugged a little bit and the state().status seems to be correct. This causes a crash (trying to wait on a start operation on an already started machine) in my application.

One thing I found weird is the _set_state function that does something like this:

if wait:
    self.client.operations.wait_for_operation(response.json()["operation"])
    if "status" in self.__dirty__:
        self.__dirty__.remove("status")
    if self.ephemeral and state == "stop":
        self.client = None
    else:
        self.sync()

Could the clearing of the __dirty__ set in a previous stop transition be causing this problem?

I am using python 3.11.3 and pylxd 2.3.1

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

No branches or pull requests

1 participant