Skip to content

Add a timeout to CI builds #103180

Description

@JelleZijlstra

The joke PR #103178 included some very slow code that runs at import time, and CI took >3 hours before I canceled it. This wastes resources and is a possible abuse vector; a malicious actor could use it to eat up our CI resource quota. We should have some reasonable timeout (1 hour?) for all CI builds.

Linked PRs

Activity

  1. kylehofmann commented on Apr 2, 2023

    @kylehofmann

    I would like to publicly apologize for the PR. It didn't turn out the way I had intended.

  2. JelleZijlstra commented on Apr 2, 2023

    @JelleZijlstra
    MemberAuthor

    No apology necessary, it's better that we find out about this problem through a well-intentioned joke.

    I was actually surprised when I saw the PR that it showed you as a first-time contributor here. Based on the level of your contributions on the Python Discord, I'm sure there's lots of useful work you could do on CPython if you are so inclined. Perhaps your next PR will be less quadratic. (And if you're not interested or don't have time, that's perfectly fine too, of course.)

  3. arhadthedev commented on Apr 2, 2023

    @arhadthedev
    Member

    Related issue (for the build step only): gh-90361.

  4. sobolevn commented on Apr 11, 2023

    @sobolevn
    Member

    I had some time to look at this. I think that we need to base timeouts:

    1. For short actions, like stale and labels
    2. For build / test actions

    Short timeout

    stale takes ~1m average to finish:
    Снимок экрана 2023-04-11 в 12 10 11

    new-bugs-notifier takes several seconds:
    Снимок экрана 2023-04-11 в 12 11 46

    check-labels also takes several seconds:
    Снимок экрана 2023-04-11 в 12 12 27

    verify-ensurepip-wheels takes several seconds:
    Снимок экрана 2023-04-11 в 12 13 34

    project-updater takes several seconds as well:
    Снимок экрана 2023-04-11 в 12 15 02

    I think that 10 minutes as a timeout is a reasonable number for this group.
    It will allow quite some performance degradation, but still keep our resources under controll.

    Slow actions

    docs can work from 10m up to 20m:
    Снимок экрана 2023-04-11 в 12 17 05

    testsmsi can take from several minutes up to 20m:
    Снимок экрана 2023-04-11 в 12 18 26

    build takes around 30m:
    Снимок экрана 2023-04-11 в 12 19 24

    So, using 1h is a resonable timeout.

    I will send a PR with these timeouts in a moment.
    Plus, I will change per-step timeouts from #90361 to be job-level (and increase them).

  5. added a commit that references this issue on Apr 11, 2023
  6. self-assigned this
    on Apr 11, 2023
  7. added a commit that references this issue on Apr 14, 2023
  8. added a commit that references this issue on Apr 14, 2023
  9. added a commit that references this issue on Apr 14, 2023
  10. added a commit that references this issue on Apr 15, 2023
  11. hauntsaninja commented on Apr 26, 2023

    @hauntsaninja
    Contributor

    Looks like this was completed, thanks all!

  12. added a commit that references this issue on Feb 21, 2025
  13. added 4 commits that reference this issue on Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildThe build process and cross-build

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions