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

Update Context to be thread-safe #44

Open
4 tasks
krlberry opened this issue Mar 6, 2025 · 1 comment
Open
4 tasks

Update Context to be thread-safe #44

krlberry opened this issue Mar 6, 2025 · 1 comment

Comments

@krlberry
Copy link
Contributor

krlberry commented Mar 6, 2025

Objective

Update the Context mechanism for the Prefect workflow to be thread-safe. The current design is not thread-safe, as indicated from testing during the previous sprint.

Some potential ideas for an approach are here: context

Requirements

  • The context mechanism has been updated to a thread-safe implementation
  • Testing to ensure that the context is thread-safe
  • Update the wiki page to include the new design for the context and documentation of the thread-safety issue that triggered the design change

Key Decision Points

  • Design for a thread-safe context.

Some possibilities include:

  • Use the Prefect database
  • Use a different database
  • REDIS
@amcnicho
Copy link
Member

amcnicho commented Mar 6, 2025

Execution of pipeline.py had errors coming from the contents of the context being mismatched with the keys written by previous stages, so when a subsequent parameterized flow requested an expected key, that failed:

  File "RADPS/prefect_workflow/stage_image_cont_selfcal.py", line 183, in solve
    n_field = datashape[src]['n_field']
KeyError: 'J1752-2956'

This was seen when the pipeline was submitted to helm deployment of prefect-server, but not when running in a local process (prefect server start &).

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

No branches or pull requests

2 participants