[facade] fix: run dependency tasks after repo clone, not in parallel#3794
Open
mn-ram wants to merge 2 commits intoaugurlabs:mainfrom
Open
[facade] fix: run dependency tasks after repo clone, not in parallel#3794mn-ram wants to merge 2 commits intoaugurlabs:mainfrom
mn-ram wants to merge 2 commits intoaugurlabs:mainfrom
Conversation
Dependency metrics tasks (process_dependency_metrics, process_libyear_dependency_metrics, process_scc_value_metrics) were placed inside a Celery group() alongside the facade core collection chain, causing them to fire concurrently with the git clone/update. This resulted in a FileNotFoundError when the tasks tried to scan directories that hadn't been written to disk yet. Fix: append the three tasks to facade_core_collection and use a single chain() so they execute strictly after the clone completes. Fixes augurlabs#3767 Signed-off-by: mn-ram <mn-ram@users.noreply.github.com>
fb9defb to
2d52a2e
Compare
Adds two unit tests for facade_phase() to guard against the race condition fixed in the previous commit (issue augurlabs#3767): 1. test_facade_phase_returns_chain - verifies the returned sequence is not a Celery group(), which would dispatch tasks in parallel. 2. test_facade_phase_dependency_tasks_follow_clone - verifies that process_dependency_metrics, process_libyear_dependency_metrics, and process_scc_value_metrics appear strictly after the git clone task in the chain, not before or alongside it. All Augur/DB dependencies are stubbed so no live environment is needed. Signed-off-by: mn-ram <mn-ram@users.noreply.github.com>
Collaborator
|
#3796 may help reduce the race condition |
Author
|
@MoralCode Thanks for the heads up! |
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.
Description
process_dependency_metrics,process_libyear_dependency_metrics, andprocess_scc_value_metricsout of Celerygroup()and into the mainfacade_core_collectionchain so they execute strictly after the git clone/update completes.groupimport fromcelery.This PR fixes #3767 (also resolves #3459 — same root cause)
Notes for Reviewers
group()dispatches all members simultaneously, so dependency tasks were racing against the git clone and hittingFileNotFoundErroron directories that didn't exist yet. Using a singlechain()guarantees ordering with no extra overhead.Signed commits