* reorganize handle_child
There were a couple issues with the current implementation:
1. When reading stdout and stderr from the child, as soon as we hit EOF
on one we would stop reading from both (line 1420). This could lead
to the return value not being read from the job program.
2. Lines read from stdout and stderr are put into a channel and read
elsewhere with `rx.recv()` (line 1497) but that channel isn't read
until empty. It is only read in the `while !done.load(...)` (line
1449) loop and that loop can stop after any `.store(true, ...)`.
Which happens when the child exits, when the job is cancelled, when
either stdout or stderr reach EOF...
This can be verified by putting `dbg!(rx.recv().await)` or a similar
assertion after the while loop before returning from that function.
It shows the channel still containing log lines on rare occasions.
I was pretty careful in this to maintain the current behaviour; adding
comments to express intention.
One difference in this is that some regular intervals (cancel check and
ping update) should be more regular?
Before...
> at 00ms wait for 10ms
> at 10ms do things for 3ms
> at 13ms wait again for *10ms*
> at 23ms do things again ...
With change...
> at 00ms wait for 10ms
> at 10ms do things for 3ms
> at 13ms wait again but for *7ms*
> at 20ms do things again ...
Which I'm guessing is preferable but I could be wrong.
* renames; interpolate values in log messages
* do `append_logs()` in tokio::task
* tokio::time::interval & close pipe after limit
* clean up comments
Flow observes `suspend` setting and will wait for resume messages sent for the job before continuing to the next step in a flow.
Adds endpoints under workspaces at `/jobs/<cancel|resume>/<job-uuid>` to either cancel or resume the job with a payload. For POST requests to the endpoint, payload is a JSON document. For GET requests to the endpoints, the payload is a base64url encoded JSON document as the value of the payload query parameter.
* progress
* progress
* all in one
* frontend
* small nits
* go job test
* go.sum is optional
* add golang-go to backend test image
Co-authored-by: sqwishy <somebody@froghat.ca>
It was possible to run them using a webhook, but not through an endpoint.
This PR aims to fix that so the user can target a specific version of
the script to run.
* flow step retry feature
* comparison constant on right side for clarity
* raise high retry values when starting a flow
also renamed duration to interval to be more specific about the retry
interval/period between tries or attempts
* add flow retry to openflow openapi
Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
* run failure_module
- renames FlowModule.input_transform to input_transforms
- parse_deno_signature prints source on failure instead of debug
representation of AST
* s/should_continue_job/should_continue_flow
* wip: step after forloop results
Adding a failing test so I don't forget out about it.
In the last step, `items` is `4`, the last item in iteration, rather
than the collected list. My guess is this is because the results aren't
collected unless the flow quits early or the forloop module is the last
module so that `last_step` is true.
* test
Co-authored-by: sqwishy <somebody@froghat.ca>