Ban infinite loop

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue
  • @tkuah started a discussion: (+1 comment)

    I wonder if we should ban loop and enforce usage of loop_until with a sensible limit

    cc @godfat

I agree. Nothing should be unbounded. We added safe_ensure_unique in app/models/application_record.rb to retry in finite times, and we can do the same for loop.

We should probably ban retry as well, and only allow it in safe_ensure_unique, and other base tools.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/63595 for an example where an infinite loop has been disastrous

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading