Pioreactor / Pioreactor/pioreactor

[what happened] Dosing automation base's has a race condition that doesn't ended the job properly.

Open
#420 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug dosing algorithms job what-happened
Dominant language
Python
Stars
149
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Suppose I have a long-running execute, ex:

def execute(...):
        from time import sleep
        from pioreactor.actions.pump import remove_waste, add_media
        for i in range(10):
            add_media(duration=1.0, unit=self.unit, experiment=self.experiment)
            sleep(5)
            remove_waste(duration=3.0, unit=self.unit, experiment=self.experiment)
        return

If I try to stop the dosing_controller job (from the UI) mid-execute, the pumping doesn't stop, and eventually LOST on the controller is thrown. The pumping doesn't stop because the automation_job has a thead.join() in it's on_disconnected.

Users should put in logic to check for state here, but does this also happen for our execute_io_action?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at automation_job.on_disconnected and its thread.join() behavior, then compare it with execute_io_action. Reproduce the issue by stopping a long-running execute from the UI; done means the pumping stops and the job ends without the controller reporting LOST.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.