Skip to content

Fix worker pool stuck on shutdown in certain cases - #4111

Merged
thampiotr merged 2 commits into
mainfrom
thampiotr/worker-pool-stuck-fix
Aug 5, 2025
Merged

Fix worker pool stuck on shutdown in certain cases#4111
thampiotr merged 2 commits into
mainfrom
thampiotr/worker-pool-stuck-fix

Conversation

@thampiotr

@thampiotr thampiotr commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

PR Description

The worker pool, if given a component that is stuck in evaluation, would not properly shutdown and could lead to Alloy being stuck in k8s. This change was lifted from #4044 and has been discussed a bit there.

In this PR we introduce a timeout for current components evaluations to conclude within 5 seconds during shutdown. This should work for most cases as a) components typically don't evaluate this long - this is calling Update() function, b) There is no guarantee that Update() functions queued are executed during shutdown currently anyway. Stop() only waits for tasks that are currently being evaluated.

Which issue(s) this PR fixes

Notes to the Reviewer

Previous discussions:

image image

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@thampiotr
thampiotr marked this pull request as ready for review August 4, 2025 13:44
@thampiotr
thampiotr requested a review from a team as a code owner August 4, 2025 13:44
@thampiotr
thampiotr requested review from kalleep and ptodev August 4, 2025 13:45
@thampiotr
thampiotr merged commit ee4ffd0 into main Aug 5, 2025
39 checks passed
@thampiotr
thampiotr deleted the thampiotr/worker-pool-stuck-fix branch August 5, 2025 09:53
dehaansa pushed a commit that referenced this pull request Aug 6, 2025
* Fix worker pool stuck on shutdown in certain cases

* Changelog

(cherry picked from commit ee4ffd0)
@dehaansa dehaansa mentioned this pull request Aug 6, 2025
kalleep pushed a commit that referenced this pull request Aug 7, 2025
* fix faro.receiver cors not allowing x-scope-orgid, traceparent headers (#4051)

* fix faro.receiver cors not allowing x-scope-orgid, traceparent headers

* sort values listed in Access-Control-Request-Headers header in test

* fix faro.receiver readme to include allowed headers list

* Update docs/sources/reference/components/faro/faro.receiver.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
(cherry picked from commit d481390)

* Ensure cluster notifications are sent to remotecfg components (#4006)

* Ensure cluster notifications are sent to remotecfg components

* Update changelog

* Address PR feedback

* add some locking for a race condition in test

(cherry picked from commit 1fa6b5a)

* Fix references to `text_file` collector and lack of`dns` config conversion (#4024)

* Fix references to  collector

* Ensure DNS config is appropriately converted for windows exporter

* add changelog

* Update docs/sources/reference/components/prometheus/prometheus.exporter.windows.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Update blurb about text_file/textfile in windows docs

* Update docs/sources/reference/components/prometheus/prometheus.exporter.windows.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
(cherry picked from commit 12d94d3)

* Update walqueue dependency for external_labels fix (#4133)

(cherry picked from commit f8607d6)

* Add metric missing features and remove unneeded validations (#4094)

(cherry picked from commit 93a6365)

* fix missed merge conflict

* fix: stage.multiline now passes through structured metadata in loki.process (#4050)

* fix: stage.multiline now passes through structured metadata in loki.process

* fix: set correct expected assert value

* Update internal/component/loki/process/stages/multiline.go

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>

* refactor: implemented review feedback about how to clone, added needed import

---------

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
(cherry picked from commit f20c549)

* Fix Windows installer values (#4125)

* Fix Windows installer values

Fix URLs appearing within quotes in the Windows installer.

* Update Windows installer publisher

Put the company name as the publisher, rather than the about URL.

* Update CHANGELOG

Add changes from PR.

(cherry picked from commit 46a9d29)

* Fix worker pool stuck on shutdown in certain cases (#4111)

* Fix worker pool stuck on shutdown in certain cases

* Changelog

(cherry picked from commit ee4ffd0)

* branch walqueue to skip prom3 in 1.10 patch

* Remove unused remotecfg code unintentionally merged

---------

Co-authored-by: Irina Marchuk <mar4ukira@gmail.com>
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
Co-authored-by: Marc Tudurí <marctc@protonmail.com>
Co-authored-by: jan-mrm <67435696+jan-mrm@users.noreply.github.com>
Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants