[Bug]: await_lock masks exceptions as FileLockError; minion job_queue requeues forever ("Failed to acquire job_queue lock" log flood)
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
salt.utils.files.await_lock から始め、with 本体の周辺にある例外処理を追跡し、その後 _handle_decoded_payload と _process_process_queue_async_impl を調べます。with 本体の例外がロック取得の失敗と区別可能なままであること、FileLockError のログに例外が含まれること、そして繰り返し失敗するキュー内のジョブが最終的に再キューイングされなくなり、master にエラーを返すことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
What happened?
On 3007.13 two minions got stuck in an infinite requeue loop, logging ~180 lines/s of
[salt.minion :1960][WARNING ] Failed to acquire job_queue lock for jid 2026..., queuing anyway.
for a week, until /var/log/salt/minion reached 9 GB and filled /var. 59 stale jids cycled every 0.3 s. No job_queue.lock file existed, fds were 45/8192, plenty of RAM. The loop started 9 s after a Timeout encountered while sending ... _return request.
Root cause, two defects that combine:
-
salt.utils.files.await_lockhides the real exception. Theyieldis inside the outertry, whoseexcept Exceptionre-raises everything asFileLockError("Error encountered obtaining file lock ..."). Any exception raised by theasync with await_lock(...)body is reported as a lock failure and its traceback is lost. In 3007.13 the body included_invoke_execution()and the proc-file write, so a job-start failure became "Failed to acquire job_queue lock". 3007.14 moved_invoke_executionout of the lock, butawait_lockitself is unchanged in 3008.x, and the minion'sexcept FileLockErrorhandler still logs without the exception. -
The disk job queue has no exit.
_process_process_queue_async_implresubmits everyqueued_*.pfile every 0.3 s (0.2 s in 3008.x) with no retry counter, max age or backoff. A job that fails deterministically at start is requeued forever.
Workaround used: stop minion, move cachedir/job_queue aside, truncate log, start.
Expected
await_lockshould not convert exceptions from thewithbody intoFileLockError(re-raise them unchanged, keep the wrapping for the lock-acquire path only)._handle_decoded_payload'sexcept FileLockErrorshould log the exception (exc_info=True).- Queued jobs need a retry limit and/or max age; after that the job is dropped with an error and a return to the master.
Type of salt install
onedir
Major version
3007 (3007.13); defect 1 and 2 still present in 3008.2 / master
What supported OS are you seeing the problem on?
Ubuntu
salt --versions-report output
Salt Version:
Salt: 3007.13
Python: /opt/saltstack/salt/bin/python3.10 (onedir)
OS: Ubuntu, cPanel hosts
- 主要言語
- Python
- スター
- 15.8k
- フォーク
- 5.6k
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 99
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
saltstack/salt のほかの issue
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme load対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
saltstack/salt#70789 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionary対応中かも @ITJamie が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'対応中かも @shawnrruss が 9 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothing対応中かも @cestercian が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
saltstack/salt#70622 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
似ている issue
-
AI bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-wallet#872 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
btclib-org/btclib#3093 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
patrickballard/wheelgap#269 ·