Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
Does the max run time setting work?
Closed { reason: Solved } liw opened 8 months ago confirmed-bug

Run 3747df67-2c08-48c1-94fc-ef2805b94c4b has now been running for over an hour and is not killed yet.

liw commented 8 months ago

Manual testing tells me it doens’t work.

liw commented 8 months ago

Analysis:

  • cib creates a TimeoutCommand and uses that to spawn a ChildProcess
  • it reads all of the child’s stdout using a RealtimeLines
  • it the waits for child to terminate using ChildProcess::wait

The timeout is only checkeed in ChildProcess::wait, not in RealtimeLines. This means that if the child doesn’t close its stdout, the waiting never starts happening. This means the max_run_time setting is effectively ignored.

I note that all working adapters, which are what cib spawns, only close their stdout after terminating.

Possible fixes:

  • Change RealtimeLines to honor the dealine for max_run_time
  • Restructure the timeoutcmd module API so that the calling thread doesn’t read stdout in a blocking way and is fed lines from the child’s stdout via a channel or something
liw commented 8 months ago

Fixed-in: ac9261bb8e669cee9562e29da44a7e0308dcc490

liw commented 8 months ago

Not actually fixed. Needs further debugging.

liw commented 8 months ago

RealtimeLines::line does not react to timeout unless child process produces output.

liw commented 8 months ago

Fixed-in: 27317200c10b027f6f32d9853976d974e52fd224

The adapter and all it’s child-processes are now reliably killed, again. There’s a problem with how the result is presented, which I’ll open as a separate issue.