Delaying unlink or write on a model whose method was replaced raises AttributeError at enqueue time
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #998 di @akarazhev — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by tracing the delayed-call method lookup and job serialization path described in the report, especially queue_job/job.py methods func, description, and _store_values. Reproduce the issue with the provided res.partner.unlink replacement and verify the behavior for both delayable() and with_delay(). Done means the job records and resolves the originally requested method name; an open linked pull request already addresses this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Module
queue_job (18.0.1.3.0).
Describe the bug
A delayed call (delayable() and with_delay()) is recorded by the __name__ of the function that the
attribute lookup happened to return, not by the name that was looked up
recordset_method = getattr(self.recordset, name)
self._job_method = recordset_method
This leads to:
File "queue_job/job.py", in _store_values
"name": self.description,
File "queue_job/job.py", in description
elif self.func.__doc__:
File "queue_job/job.py", in func
return getattr(recordset, self.method_name)
AttributeError: 'res.partner' object has no attribute 'unlink_renamed'
To Reproduce
Affected Versions:
Occured on 18.0 but code is unchanged on newer versions.
cls = type(env["res.partner"])
original = cls.unlink
def unlink_renamed(self):
return unlink_renamed.origin(self)
unlink_renamed.origin = original
cls.unlink = unlink_renamed
partner = env["res.partner"].create({"name": "test"})
partner.delayable().unlink().delay()
Expected behavior
The job records the method under the name it was requested with, and resolves
that name again, independent of what the attribute currently points at.
Additional context
Where this shows up in practice
auditlog (https://github.com/OCA/server-tools) installs its replacements as write_full and unlink_full into
the write and unlink slots, so any delayed write or unlink on an
audited model fails this way.
- Lingua principale
- Python
- Stelle
- 271
- Fork
- 602
- Merge medio
- 4g 4h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OCA/queue
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Migration to version 20.0Apertahelp wanted no stale work in progress
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
[19.0] queue_job: Jobs stay pending after the jobrunner's database connection is silently droppedForse già presa @HoloborodkoBohdan l’ha presa 32 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
OCA/queue#984 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
OCA/queue#964 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
ai_p2 bug comp-datalake
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ClickHouse/ClickHouse#128306 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] PROPOSE docs promise approval before saving, but save_learning has no confirmation flagAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
[bug] openlit: LLM spans from openlit 1.37+ get no OpenInference attributes, and cache and reasoning token counts are droppedForse già presa @sohom-cs l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Arize-ai/openinference#4199 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
MichaelYcJo/SpecSeal#1192 ·