bug: timeout-minutes on a job step is not respected #979

Closed
opened 2025-09-10 22:48:13 +00:00 by alexrp · 4 comments
Contributor

Can you reproduce the bug on the Forgejo test instance?

No

Description

See this run: https://codeberg.org/ziglang/zig/actions/runs/9

In this commit, the timeout-minutes value is 5 for all steps, yet none of them get canceled.

We're currently evaluating Forgejo Actions on Codeberg for the development of Zig and this is a serious concern for us since we fairly often deal with nondeterministic hangs, and we need to know that jobs will be reliably timed out when such hangs occur.

Forgejo Version

Codeberg current (v12.x?)

Runner Version

v11.0.0

How are you running Forgejo?

Codeberg

How are you running the Runner?

Built from source with make build but otherwise following the installation guide.

Logs

I can attach the full debug log if desired (once the job completes), but there is nothing that looks at all relevant, except:

Sep 10 23:53:40 io forgejo-runner[2622263]: time="2025-09-10T23:53:40+02:00" level=debug msg="Job.TimeoutMinutes: 5" func="[func1]" file="[runner.go:163]"

So, it's parsing the correct value; it just doesn't seem to take effect in any meaningful way - there isn't even an attempt to cancel the job.

Workflow file

ziglang/zig@aa36c89588/.forgejo/workflows/ci.yaml

### Can you reproduce the bug on the Forgejo test instance? No ### Description See this run: https://codeberg.org/ziglang/zig/actions/runs/9 In this commit, the `timeout-minutes` value is `5` for all steps, yet none of them get canceled. We're currently evaluating Forgejo Actions on Codeberg for the development of Zig and this is a serious concern for us since we fairly often deal with nondeterministic hangs, and we need to know that jobs will be reliably timed out when such hangs occur. ### Forgejo Version Codeberg current (v12.x?) ### Runner Version v11.0.0 ### How are you running Forgejo? Codeberg ### How are you running the Runner? Built from source with `make build` but otherwise following the installation guide. ### Logs I can attach the full debug log if desired (once the job completes), but there is nothing that looks at all relevant, except: ``` Sep 10 23:53:40 io forgejo-runner[2622263]: time="2025-09-10T23:53:40+02:00" level=debug msg="Job.TimeoutMinutes: 5" func="[func1]" file="[runner.go:163]" ``` So, it's parsing the correct value; it just doesn't seem to take effect in any meaningful way - there isn't even an attempt to cancel the job. ### Workflow file https://codeberg.org/ziglang/zig/src/commit/aa36c89588f6ad448e0b9651a04d6a89eede15e4/.forgejo/workflows/ci.yaml
Author
Contributor

Note: The run linked above did get canceled, but that was because I made an unrelated push to the same branch, not due to a timeout.

Note: The run linked above did get canceled, but that was because I made an unrelated push to the same branch, not due to a timeout.
Owner

I confirm the timeout-minutes for jobs is currently a noop.

act/model/workflow.go
212:	TimeoutMinutes string                    `yaml:"timeout-minutes"`
act/runner/runner.go
163:				log.Debugf("Job.TimeoutMinutes: %v", job.TimeoutMinutes)

The timeout-minutes is implemented and documented for steps and that could be a workaround until this is fixed

https://forgejo.org/docs/next/user/actions/reference/#jobsjob_idstepstimeout-minutes

I have verified it works as expected at https://v13.next.forgejo.org/earl-warren/testtimeout-minutes/actions/runs/2/jobs/0/attempt/1

image

I confirm the timeout-minutes for jobs is currently a noop. ``` act/model/workflow.go 212: TimeoutMinutes string `yaml:"timeout-minutes"` act/runner/runner.go 163: log.Debugf("Job.TimeoutMinutes: %v", job.TimeoutMinutes) ``` The timeout-minutes is implemented and documented for steps and that could be a workaround until this is fixed https://forgejo.org/docs/next/user/actions/reference/#jobsjob_idstepstimeout-minutes I have verified it works as expected at https://v13.next.forgejo.org/earl-warren/testtimeout-minutes/actions/runs/2/jobs/0/attempt/1 ![image](/attachments/6e532485-616c-451c-aa26-24a607055b81)
Owner

The documentation part of the fix is at https://codeberg.org/forgejo/docs/pulls/1459

The documentation part of the fix is at https://codeberg.org/forgejo/docs/pulls/1459
Author
Contributor

I can confirm that a step-level timeout-minutes works for us as well. Thanks for the workaround, and the fix PR!

I can confirm that a step-level `timeout-minutes` works for us as well. Thanks for the workaround, and the fix PR!
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner#979
No description provided.