farmbot_os icon indicating copy to clipboard operation
farmbot_os copied to clipboard

Sequence Queueing Issues

Open RickCarlino opened this issue 4 years ago • 3 comments

Forum user dmbgo states that executing a sequence while one is already running causes unexpected behavior. Link to original forum post.

RickCarlino avatar Jan 13 '20 13:01 RickCarlino

@RickCarlino I had a play with this. The only 2 ways that I found to make it happen ( probably same underlying mechanism ) is by

A) Using the TEST button on the Sequences page, e.g.

  • Select first Sequence, press TEST
  • quickly Select a different Sequence, press TEST

B) Running a device client using CeleryScript RPC over MQTT

  • Quickly Publish 2 execute requests ( different sequence numbers ) without waiting for rpc_ok.

Do the Sequences Use-Cases ( Stories :) allow for Canceling a running Sequence ? Do we need to "serialize" Sequence requests ? . . or "cancel" all running ones if a new one arrives ?

jsimmonds2 avatar Jan 15 '20 01:01 jsimmonds2

Thanks so much for doing the research, @jsimmonds2 ! This is 100% still a bug, but it is good to know that it is confined to edge cases.

Do the Sequences Use-Cases ( Stories :) allow for Canceling a running Sequence ?

This is possible via e-stop. Did you have a different use case in mind?

Do we need to "serialize" Sequence requests ? . . or "cancel" all running ones if a new one arrives ?

It's been a while since I've looked into this part of the app, and its not how I typically use my device so I will need to give it a look. I have a hunch that we designed queueing as the intended default behavior, if memory serves me correct. Will need to investigate further. Details to follow

RickCarlino avatar Jan 15 '20 13:01 RickCarlino

I can confirm this happens when running two sequences from the Run button in the Sequence designer.

I was running (via Run button) a sequence that takes photos of the entire garden bed. While it was doing that for a bit, I tapped Run on another sequence that scans the bed for weeds.

The expected behaviour was that it would either perform that sequence after finishing the current running one, OR it would abort the current running one immediately to start the triggered one.

The observed behaviour was that FarmBot now started ping-ponging between coordinates and taking normal photos and plant detection photos (and getting them mixed up in the process).

mdingena avatar Mar 09 '21 00:03 mdingena