Repository navigation
[19.0] [FIX] edi_queue_oca: drop file checksum from job identity key - #380
Closed
ivantodorovich wants to merge 1 commit into
Closed
ivantodorovich wants to merge 1 commit into
ivantodorovich wants to merge 1 commit into
Conversation
The send job chained to a generation is queued before the file exists, so the output cron queued a second send for the same record, and both ran. The jobs read the file when they run, the checksum is not needed.
Contributor
Author
|
Actually this causes a regression in case of a failed generate job, that would keep its dependant send job forever waiting dependencies -- and that counts for the identity_key deduplication. The issue is bigger than this, so I'm putting it on hold for now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't queue a second send job for a record whose send is already chained to its generation
The job identity key includes the file checksum:
edi-framework/edi_queue_oca/utils.py
Lines 11 to 16 in 176f585
But the send job chained to the generation is queued before the file exists, so its key holds the checksum of an empty file:
edi-framework/edi_queue_oca/models/edi_exchange_record.py
Lines 99 to 104 in 176f585
If the send doesn't run right away (e.g. with a job ETA), the output cron finds the record in output_pending and queues another send, this time with the checksum of the generated file. The keys don't match, so it isn't deduplicated:
edi-framework/edi_core_oca/models/edi_backend.py
Lines 395 to 396 in 176f585
Steps to reproduce:
The checksum isn't needed: the jobs read the file when they run, not when they're queued, so a pending job already sends the latest content. The solution is to drop it and use the plain
identity_exactinstead.