You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using queue job (thanks btw, excellent addon) I notice that I get these errors quite often:
2024-10-23 06:52:13,986 21661 ERROR kastenman odoo.sql_db: bad query: UPDATE "product_product" SET "write_date" = '2024-10-23 06:51:40.258346', "write_uid" = 1 WHERE id IN (9350)
ERROR: could not serialize access due to concurrent update
Thing is, I use job queue to fetch an image from a website that takes a couple of seconds to load, so there is a relatively long time between the beginning of the job and the end. In the meantime, all sorts of other changes could happen on the related product product model record.
So, can someone tell me whether this is potentially due to queue job and, hence, I should seek to shorten the time needed to run the job?
The text was updated successfully, but these errors were encountered:
I see a fair number of serialization failures, especially for my jobs that run massively parallel. If your external calls (such as to download the image) are not mutating anything, I would just try again:
Another strategy might be to break your job into pieces. For example, change your job to download the image then create a second job that updates the database. That way you don't have a transaction open for a long time. I have a number of order of operations issues when importing data from external systems that I solve like this.
The thing is, from the documentation I gather that with job queue I can only schedule it by linking it to a model record? So using queue job without it being attached to a model record is not clear to me. In any case, I managed to solve the serialization issue after a very long dig around by removing a custom depends on my model which was updating stuff under the hood. So queue job was not causing it as such.
When using queue job (thanks btw, excellent addon) I notice that I get these errors quite often:
2024-10-23 06:52:13,986 21661 ERROR kastenman odoo.sql_db: bad query: UPDATE "product_product" SET "write_date" = '2024-10-23 06:51:40.258346', "write_uid" = 1 WHERE id IN (9350)
ERROR: could not serialize access due to concurrent update
Thing is, I use job queue to fetch an image from a website that takes a couple of seconds to load, so there is a relatively long time between the beginning of the job and the end. In the meantime, all sorts of other changes could happen on the related product product model record.
So, can someone tell me whether this is potentially due to queue job and, hence, I should seek to shorten the time needed to run the job?
The text was updated successfully, but these errors were encountered: