Repository navigation
Conversation
Motivation: salt.utils.files.await_lock yields inside a try whose broad `except Exception` re-raised everything as FileLockError. Any exception raised by the body of `async with await_lock(...)` was therefore reported by the minion as "Failed to acquire job_queue lock ... queuing anyway", with the real traceback lost. The minion's handler also logged without the exception. Approach: track whether control was handed to the with-body and re-raise body exceptions unchanged; lock-acquire failures still become FileLockError. The minion's warning now logs with exc_info=True. Adds a changelog entry. Not addressed: the issue's third point (retry limit / max age for the disk job queue) is a larger design change and is left out. The sync wait_lock has the same pattern and is left unchanged here. Validation: added test_await_lock_does_not_mask_body_exceptions in tests/pytests/unit/utils/test_files.py. It fails before the change (the ValueError is converted to FileLockError) and passes after; the whole test_files.py module passes (18 passed, 2 skipped). tests/pytests/unit/test_minion.py shows the same 2 failures with and without this change (49 passed). Not run: a live minion reproduction of the log flood. Report: saltstack#70229 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
What does this PR do?
salt.utils.files.await_lockno longer converts exceptions raised inside itsasync withbody intoFileLockError; they propagate unchanged (lock-acquire failures still raiseFileLockError). The minion's "Failed to acquire job_queue lock" warning now includes the traceback. The retry limit for the disk job queue from the issue is not part of this PR.What issues does this PR fix or reference?
Relates to #70229
Previous Behavior
A body exception was reported as a lock failure and its traceback was lost.
New Behavior
Body exceptions propagate with their original type and traceback.
Merge requirements satisfied?
New test fails before and passes after the change.
test_minion.pyhas 2 failures that are identical without the change. I did not reproduce the live log flood.Commits signed with GPG?
No (DCO sign-off only)
This PR was written in part with the assistance of generative AI.
Fixes #70229