[19.0][FIX] edi_core_oca: use savepoint to prevent state corruption on errors - #316
Conversation
Some errors such as ValueError, FileNotFoundError, exceptions.UserError, exceptions.ValidationError, are caught, never re-raised, and the transaction is finally committed. Which means a UserError/ValidationError gets committed, leading to corruption of the processed data.
|
/ocabot merge patch |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 4bce3cf. Thanks a lot for contributing to OCA. ❤️ |
@HviorForgeFlow do you have more details about this? Are you sure it is related? As far as I know, successful savepoints do not alter the environment or the context. BTW we are using this patch in production (in 18.0 though) since May 21th alongside edi_queue_oca. |
|
@guewen I need investigate further but take a look on the error on the process: |
|
That's weird indeed. The savepoint does a flush, perhaps at this point in the code execution any flush would crash like this, so the fact that it happens on this savepoint might be only a symptom? |
|
By default queue job do a savepoint, but when doing the second by edi_core_oca, it crashes...need further investigation yes...maybe in v18 it is not happening, or just the code don't check the user or other context which don't crash anything. |
|
@HviorForgeFlow it may be related to this OCA/queue#922 actually? |
|
@guewen I have looked into it, and yes, it seems OCA/queue#923 fixes the issue @HviorForgeFlow faced. |
Forward #284