-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.0] Concurrent Update Issue when number of server is more than 1 #103
Comments
Can you show the definition of your job function with concurrent update issues? |
Job Function def send_approve_action(self): @api.multi Another model like my.plan @api.multi Getting Below Error: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): I'm getting this error when i run my database with more than 2 CPU(Nodes). Thanks. |
This seems to be unrelated to the job queue, if you look at the traceback, you'll see that your function writes to a bunch of models, partner, mail thread, mail activity, ... if you have 2 concurrent jobs that write to the same record, you'll have a concurrent transaction error. The queue job automatically retries the jobs when there is such error, but only a certain amount of times after what it sets the job as failed. I mean, if you were running the same function on the same record using xml-rpc on several concurrent requests, you would have the same issue. What you should track here is why you have several jobs calling the function for the same record. If this is unavoidable, then you should probably set the job function in a channel with a capacity of 1 so you won't have more than 1 job running at once. |
I'm not getting any error when my no.of CPU is 1. If changed my no.of CPU is 2 i'm getting this concurrent error and also load-balancer not worked in Job Queue.so this related to load-balancing issue. Error: |
The last traceback is different, it's not inside the job but an error in the jobrunner, it could use some investigation. |
The errors in #103 (comment) were not the same, so you are not repeating anything. Having concurrent issues is of course more likely to happen when you actually run things concurrently, it doesn't really help to repeat it. The useful information is more what you actually get, like the traceback in #103 (comment). I'm not sure to understand the relation between the number of CPUs (CPU cores?) and a load balancer? When you say CPU aren't you speaking about different hosts/different odoo processes? If so, ensure that you don't run 2 jobrunner concurrently because this is not supported. Edit: reread the first post and indeed by CPU you mean servers... that got me confused. Run the jobrunner on only one of them. |
My intension. Consider CPU 1 and CPU 2 in idle stage. |
As said before, you should start the jobrunner on only one server, precisely, you must have |
I have 4 servers but my code is common to all. My configuration [queue_job] Thanks |
Yes,
|
Your code can be the same, but you have to find a solution to have a different odoo configuration. I can't help you more... |
@guewen Hi Guewen, regarding this, can we add an option running job this way? |
In my production, i have 4 servers[CPU] and capacity of channel is 1.When i run the job i got the concurrent update issue. But In local machine i'm not getting any issues. It works perfectly.
What went wrong ? It works perfectly in my local but in production getting concurrent update issue.
The text was updated successfully, but these errors were encountered: