[Bug]: await_lock masks exceptions as FileLockError; minion job_queue requeues forever ("Failed to acquire job_queue lock" log flood)
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- devops, distributed-systems
Línea de trabajo
Comienza con salt.utils.files.await_lock y sigue su manejo de excepciones alrededor del cuerpo de with; después, inspecciona _handle_decoded_payload y _process_process_queue_async_impl. Confirma que las excepciones del cuerpo sigan siendo distinguibles de los fallos al adquirir el lock, que el registro de FileLockError incluya la excepción y que los jobs encolados que fallan repetidamente dejen finalmente de volver a encolarse y devuelvan un error al master.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 15.8k
- Forks
- 5.6k
- Merge medio
- 5 d 9 h
- PR fusionados (30 d)
- 99
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de saltstack/salt
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
saltstack/salt#70789 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionaryPosiblemente ocupada @ITJamie la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'Posiblemente ocupada @shawnrruss la tomó hace 9 días. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothingPosiblemente ocupada @cestercian la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
saltstack/salt#70622 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de saltstack/salt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-wallet#872 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
btclib-org/btclib#3093 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
patrickballard/wheelgap#269 ·
-
priority: low python
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
LearningCircuit/local-deep-research#8635 ·
Los mantenedores suelen responder en 1 día
-
README says the land/sea mask must match the XS grid; the demo mask does not, and Step 4 worksAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
buckai-observatory/Automated-Cloud-Removal-and-Seamless-Satellite-Image-Mosaicking-Pipeline#52 ·
Los mantenedores suelen responder en 1 día