-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
[12.0][IMP] edi_oca: don't consider exchange records if jobs have been created #996
base: 12.0
Are you sure you want to change the base?
Conversation
a2b52fc
to
e41329a
Compare
@simahawk what's your opinion on this? |
e41329a
to
7c00765
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid having this kind of relations w/ jobs.
Please see OCA/queue#573
As for the solution on how to prevent the issue to happen... IMO we should rely on
the id key https://github.com/OCA/edi-framework/blob/16.0/edi_oca/models/edi_exchange_record.py#L591
And we should leverage the job chaining for inbound records too to speed up processing.
FYI there's a way to find jobs for a record OCA/edi-framework#93
Regarding the error itself: an alternative would be to simply let the job fail gracefully (meaning set it as done).
BTW I was thinking that we probably need a specific state for when a record is waiting for a job... not sure tho.
4f2effb
to
181dffa
Compare
fd3a90e
to
9d6b406
Compare
9d6b406
to
a7f0b8c
Compare
@simahawk is it acceptable now? It became simpler. |
Yeah, but silencing possible errors it's bad coding. I prefer avoiding from happening the specific detected ones, and letting the open door to detect other errors.
A new state between "new" and the others, for example "queued" would be nice, but I am afraid that it's complicated, as we should review all the flows and adapt code. I prefer the boolean solution, it's simpler. |
@simahawk could you take a look? |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
If two
_check_output_exchange_sync
are called consecutively, one after the other, maybe due to_execute_next_action
method, the following error happens:Both
_check_output_exchange_sync
calls detect the same exchange records, and both create same jobs. The first batch of jobs will be processed but the second ones will fail due to check of state = "new".