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

Failure to reload the subprocess gets blueapi into an unrecoverable state #512

Closed
callumforrester opened this issue Jun 19, 2024 · 2 comments · Fixed by #514
Closed

Failure to reload the subprocess gets blueapi into an unrecoverable state #512

callumforrester opened this issue Jun 19, 2024 · 2 comments · Fixed by #514
Assignees
Labels
bug Something isn't working

Comments

@callumforrester
Copy link
Contributor

To reproduce:

  1. Run blueapi against a scratch area
  2. Edit the code to introduce a fatal bug (e.g. a syntax error)
  3. Reload
  4. Fix the bug
  5. Try to reload again
@callumforrester callumforrester added the bug Something isn't working label Jun 19, 2024
@joeshannon joeshannon self-assigned this Jun 19, 2024
@joeshannon
Copy link
Contributor

The cause of this is that in the endpoint for environment DELETE, the context is only restarted if there exists an initialized context already. The intention was to prevent repeated calls to the endpoint from "stacking up" however on reflection this might not really have been addressed.

When there is a failure the initialized property on SubprocessHandler is never set to true.

We should add an error property to the environment context to allow it to restart if there are errors too.

It can be added to the environment entity.

joeshannon added a commit that referenced this issue Jun 19, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 20, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 20, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 20, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
@stan-dot
Copy link
Contributor

I think with #504 we wouldn't have this kind of issue

joeshannon added a commit that referenced this issue Jun 21, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
It is the worker state rather than the overall state of blueapi.

The "state" name may be used to replace the current "initialized" in
order to provide more context about the "environment"

Prerequisite to #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error field to the environment. This is now checked
against when attempting to delete the environment as if there is an
error the handler is never set to initialized.

Note that the property has only been added to SubprocessHandler as
the BlueskyHandler ABC is likely to be removed.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 25, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 26, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 26, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 26, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 26, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
joeshannon added a commit that referenced this issue Jun 26, 2024
This adds a new error_message field to the environment. Its presence is
now checked against when attempting to delete the environment as if
there is an error the handler is never set to initialized, so previously
could not be reloaded.

Fixes #512.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants