Skip to content

fix(list): avoid deadlock in helmfile list with more than 100 states - #2773

Merged
yxxhero merged 1 commit into
helmfile:mainfrom
max06:fix/list-deadlock-many-states
Sep 10, 2026
Merged

yxxhero merged 1 commit into
helmfile:mainfrom
max06:fix/list-deadlock-many-states

Conversation

@max06

@max06 max06 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Resolves #2772

What

ListReleases collected per-state results through make(chan []*HelmRelease, 100) and only drained the channel after ForEachState returned. With more than 100 states carrying releases the 101st send blocked forever, so helmfile list hung with no output (and ignored SIGTERM).

This PR appends to the result slice under a mutex instead. ForEachState may invoke the callback concurrently, and the existing sort.Slice already makes the output order deterministic, so the output is unchanged.

Test

TestListWithManyStates builds 101 helmfile.d states with one release each and lists them with a 60 s guard, so a regression fails fast instead of hanging until the go test timeout. Against the previous code the test fails with
ListReleases did not return within 60s for 101 states: deadlock while collecting releases; with this change go test ./pkg/app/ -run TestList passes.


Written by Claude (Anthropic's Claude Code) on behalf of @max06; DCO sign-off by the human author.

@yxxhero
yxxhero force-pushed the fix/list-deadlock-many-states branch from afae9af to 44b2ef4 Compare September 10, 2026 00:42
… than 100 states

ListReleases gathered per-state results through a channel with a fixed
buffer of 100 that was drained only after ForEachState had visited every
state. The 101st state carrying releases therefore blocked on the send
forever: `helmfile list` hung with no output and ignored SIGTERM.

Append to the result slice under a mutex instead. ForEachState may run the
callback concurrently, and the existing sort keeps the output order
deterministic, so nothing else changes.

Adds TestListWithManyStates (101 helmfile.d states, fails fast on a hang).

Resolves helmfile#2772

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Florian Müller <[email protected]>
@yxxhero
yxxhero force-pushed the fix/list-deadlock-many-states branch from 44b2ef4 to 1044c57 Compare September 10, 2026 23:13
@yxxhero
yxxhero merged commit 5a241f6 into helmfile:main Sep 10, 2026
16 checks passed
hbjydev pushed a commit to hbjydev/phoebe that referenced this pull request Sep 14, 2026
…601)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | minor | `1.7.4` → `1.8.0` |

---

### Release Notes

<details>
<summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary>

### [`v1.8.0`](https://github.com/helmfile/helmfile/releases/tag/v1.8.0)

[Compare Source](helmfile/helmfile@v1.7.4...v1.8.0)

#### What's Changed

- build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2749](helmfile/helmfile#2749)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.36 to 1.32.37 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2750](helmfile/helmfile#2750)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.1 to 1.107.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2751](helmfile/helmfile#2751)
- build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2752](helmfile/helmfile#2752)
- docs: fix broken star history chart by [@&#8203;Dessalines39394](https://github.com/Dessalines39394) in [#&#8203;2742](helmfile/helmfile#2742)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.27 to 0.0.28 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2753](helmfile/helmfile#2753)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.37 to 1.32.38 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2755](helmfile/helmfile#2755)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.2 to 1.107.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2756](helmfile/helmfile#2756)
- build(deps): bump helm-diff to v3.15.12 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2759](helmfile/helmfile#2759)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.38 to 1.33.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2762](helmfile/helmfile#2762)
- build(deps): bump github.com/gofrs/flock from 0.13.0 to 0.13.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2761](helmfile/helmfile#2761)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.3 to 1.109.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2760](helmfile/helmfile#2760)
- build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2763](helmfile/helmfile#2763)
- feat: allow helmfile to continue on failed releases by [@&#8203;ceriath](https://github.com/ceriath) in [#&#8203;2616](helmfile/helmfile#2616)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.109.1 to 1.110.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2764](helmfile/helmfile#2764)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.1 to 1.33.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2765](helmfile/helmfile#2765)
- fix: resolve OCI version constraints before deriving the shared chart cache path by [@&#8203;samifruit514](https://github.com/samifruit514) in [#&#8203;2768](helmfile/helmfile#2768)
- feat: opt-in OpenTelemetry tracing and metrics (experimental) by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2769](helmfile/helmfile#2769)
- build(deps): bump go.opentelemetry.io/otel from 1.44.0 to 1.46.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2778](helmfile/helmfile#2778)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.28 to 0.0.29 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2776](helmfile/helmfile#2776)
- build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.44.0 to 1.46.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2777](helmfile/helmfile#2777)
- build(deps): bump go.opentelemetry.io/proto/otlp from 1.10.0 to 1.11.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2774](helmfile/helmfile#2774)
- build(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.46.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2775](helmfile/helmfile#2775)
- build(deps): bump gitpython from 3.1.58 to 3.1.59 in /docs by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2785](helmfile/helmfile#2785)
- build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2784](helmfile/helmfile#2784)
- build(deps): bump google.golang.org/protobuf from 1.36.12-0.20260120151049-f2248ac996af to 1.36.12 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2783](helmfile/helmfile#2783)
- build(deps): bump golang.org/x/sync from 0.22.0 to 0.23.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2782](helmfile/helmfile#2782)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.2 to 1.33.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2781](helmfile/helmfile#2781)
- build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.67.0 to 0.71.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2780](helmfile/helmfile#2780)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.110.0 to 1.111.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2779](helmfile/helmfile#2779)
- fix(list): avoid deadlock in `helmfile list` with more than 100 states by [@&#8203;max06](https://github.com/max06) in [#&#8203;2773](helmfile/helmfile#2773)
- chore: bump Helm to v3.22.0 and v4.3.0 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2786](helmfile/helmfile#2786)
- build(deps): bump helm-diff to v3.15.13 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2788](helmfile/helmfile#2788)
- feat(remote): support wildcards in remote values/secrets file selectors by [@&#8203;hoppla20](https://github.com/hoppla20) in [#&#8203;2787](helmfile/helmfile#2787)
- build(deps): bump helmfile/vals from v0.46.0 to v0.46.1 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2789](helmfile/helmfile#2789)

#### New Contributors

- [@&#8203;Dessalines39394](https://github.com/Dessalines39394) made their first contribution in [#&#8203;2742](helmfile/helmfile#2742)
- [@&#8203;samifruit514](https://github.com/samifruit514) made their first contribution in [#&#8203;2768](helmfile/helmfile#2768)
- [@&#8203;max06](https://github.com/max06) made their first contribution in [#&#8203;2773](helmfile/helmfile#2773)
- [@&#8203;hoppla20](https://github.com/hoppla20) made their first contribution in [#&#8203;2787](helmfile/helmfile#2787)

**Full Changelog**: <helmfile/helmfile@v1.7.4...v1.8.0>

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/London)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43OS42IiwidXBkYXRlZEluVmVyIjoiNDQuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==-->

Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/601
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
helmfile 1.8.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 by @dependabot[bot] in helmfile/helmfile#2749
* build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.36 to 1.32.37 by @dependabot[bot] in helmfile/helmfile#2750
* build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.1 to 1.107.2 by @dependabot[bot] in helmfile/helmfile#2751
* build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 by @dependabot[bot] in helmfile/helmfile#2752
* docs: fix broken star history chart by @Dessalines39394 in helmfile/helmfile#2742
* build(deps): bump github.com/mattn/go-runewidth from 0.0.27 to 0.0.28 by @dependabot[bot] in helmfile/helmfile#2753
* build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.37 to 1.32.38 by @dependabot[bot] in helmfile/helmfile#2755
* build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.2 to 1.107.3 by @dependabot[bot] in helmfile/helmfile#2756
* build(deps): bump helm-diff to v3.15.12 by @yxxhero in helmfile/helmfile#2759
* build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.38 to 1.33.1 by @dependabot[bot] in helmfile/helmfile#2762
* build(deps): bump github.com/gofrs/flock from 0.13.0 to 0.13.1 by @dependabot[bot] in helmfile/helmfile#2761
* build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.3 to 1.109.1 by @dependabot[bot] in helmfile/helmfile#2760
* build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 by @dependabot[bot] in helmfile/helmfile#2763
* feat: allow helmfile to continue on failed releases by @ceriath in helmfile/helmfile#2616
* build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.109.1 to 1.110.0 by @dependabot[bot] in helmfile/helmfile#2764
* build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.1 to 1.33.2 by @dependabot[bot] in helmfile/helmfile#2765
* fix: resolve OCI version constraints before deriving the shared chart cache path by @samifruit514 in helmfile/helmfile#2768
* feat: opt-in OpenTelemetry tracing and metrics (experimental) by @yxxhero in helmfile/helmfile#2769
* build(deps): bump go.opentelemetry.io/otel from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2778
* build(deps): bump github.com/mattn/go-runewidth from 0.0.28 to 0.0.29 by @dependabot[bot] in helmfile/helmfile#2776
* build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2777
* build(deps): bump go.opentelemetry.io/proto/otlp from 1.10.0 to 1.11.0 by @dependabot[bot] in helmfile/helmfile#2774
* build(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2775
* build(deps): bump gitpython from 3.1.58 to 3.1.59 in /docs by @dependabot[bot] in helmfile/helmfile#2785
* build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 by @dependabot[bot] in helmfile/helmfile#2784
* build(deps): bump google.golang.org/protobuf from 1.36.12-0.20260120151049-f2248ac996af to 1.36.12 by @dependabot[bot] in helmfile/helmfile#2783
* build(deps): bump golang.org/x/sync from 0.22.0 to 0.23.0 by @dependabot[bot] in helmfile/helmfile#2782
* build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.2 to 1.33.3 by @dependabot[bot] in helmfile/helmfile#2781
* build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.67.0 to 0.71.0 by @dependabot[bot] in helmfile/helmfile#2780
* build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.110.0 to 1.111.0 by @dependabot[bot] in helmfile/helmfile#2779
* fix(list): avoid deadlock in `helmfile list` with more than 100 states by @max06 in helmfile/helmfile#2773
* chore: bump Helm to v3.22.0 and v4.3.0 by @yxxhero in helmfile/helmfile#2786
* build(deps): bump helm-diff to v3.15.13 by @yxxhero in helmfile/helmfile#2788
* feat(remote): support wildcards in remote values/secrets file selectors by @hoppla20 in helmfile/helmfile#2787
* build(deps): bump helmfile/vals from v0.46.0 to v0.46.1 by @yxxhero in helmfile/helmfile#2789

## New Contributors
* @Dessalines39394 made their first contribution in helmfile/helmfile#2742
* @samifruit514 made their first contribution in helmfile/helmfile#2768
* @max06 made their first contribution in helmfile/helmfile#2773
* @hoppla20 made their first contribution in helmfile/helmfile#2787

**Full Changelog**: https://github.com/helmfile/helmfile/compare/v1.7.4...v1.8.0</pre>
  <p>View the full release notes at <a href="https://github.com/helmfile/helmfile/releases/tag/v1.8.0">https://github.com/helmfile/helmfile/releases/tag/v1.8.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!20121
max06 added a commit to max06/atlas that referenced this pull request Oct 12, 2026
…on lookups (#81)

- **CI matrix** (`tests.yml`): adds helm `v4.3.0` and helmfile `v1.8.1`,
so every supported minor is tested with its latest patch release, plus
`latest`.
- **Authenticated version lookups** (`tests.yml`, `test-actions.yml`):
the `api.github.com` calls that resolve `latest` send the workflow
token. Unauthenticated, they hit the rate limit (HTTP 403) and the job
failed with an empty version (seen twice on #78).
- **Action images**: atlas-render → helm 4.3.0, helmfile 1.8.1, sops
3.13.3, yq 4.54.1, kustomize 5.8.3; atlas-diff → yq 4.54.1.

## Verification

A/B render of a repository with 264 deployments (1830 files), old
against new tool versions:

- helm/helmfile/sops/yq: formatting only (blank lines, one trailing
space, one leading `---`); the parsed YAML is identical.
- kustomize 5.6.0 → 5.8.3: the `namespace` field is no longer set on the
cluster-scoped `ValidatingAdmissionPolicy` and
`ValidatingAdmissionPolicyBinding` of the gateway-api install.
Everything else is identical.

helmfile 1.8.1 includes the fix for the `helmfile list` deadlock with
more than 100 states (helmfile/helmfile#2773); its own image ships helm
4.3.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

helmfile list deadlocks when more than 100 nested states contain releases

2 participants