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

Fix reloading the environment if there is an error #514

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

joeshannon
Copy link
Contributor

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.

Copy link
Contributor Author

@joeshannon joeshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only added the error property to the subprocess handler (and not the ABC). This has required changes to some of the typing in main.py.

I'm a bit unsure but I thought it might save some work and if the handler is to be removed soon anyway then it could make sense.

What do you think @callumforrester @DiamondJoseph .

Note for me: the schema needs to be regenerated too.

@joeshannon
Copy link
Contributor Author

I have only added the error property to the subprocess handler (and not the ABC).

Looking at the test failures now it seems the handler implementation is variable, perhaps I should just add to the ABC.

@joeshannon joeshannon force-pushed the 512-reloading-env-after-error branch 4 times, most recently from aa88466 to 3267dc8 Compare June 21, 2024 16:33
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.10%. Comparing base (2c84311) to head (416ffc5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
+ Coverage   91.06%   91.10%   +0.04%     
==========================================
  Files          40       40              
  Lines        1779     1787       +8     
==========================================
+ Hits         1620     1628       +8     
  Misses        159      159              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

joeshannon added a commit that referenced this pull request 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 #514.
joeshannon added a commit that referenced this pull request 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 #514.
joeshannon added a commit that referenced this pull request 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 #514.
joeshannon added a commit that referenced this pull request 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 #514.
@joeshannon joeshannon force-pushed the 512-reloading-env-after-error branch 9 times, most recently from 44bbb3f to eb3055a Compare June 26, 2024 12:40
Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a small nitpick, looks good, thanks!

src/blueapi/service/main.py Outdated Show resolved Hide resolved
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 joeshannon force-pushed the 512-reloading-env-after-error branch from eb3055a to 416ffc5 Compare June 26, 2024 13:35
@joeshannon joeshannon merged commit 11f26d3 into main Jun 26, 2024
24 checks passed
@joeshannon joeshannon deleted the 512-reloading-env-after-error branch June 26, 2024 15:36
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

Successfully merging this pull request may close these issues.

Failure to reload the subprocess gets blueapi into an unrecoverable state
2 participants