Implement module visit tracking to prevent dependency cycles during downloads#300
Merged
Conversation
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.
This pull request introduces a tracking mechanism to detect and prevent dependency cycles during module downloads in
dmf-get. It adds a visit-state table to track which modules are being processed or have already been processed, ensuring that cycles are detected and duplicate work is avoided. Additionally, the download logic is updated to use this mechanism and to correctly finalize the visit state on completion or error.Dependency cycle detection and state tracking:
ModuleVisitEntry_tand related functions (FindModuleVisitEntry,SetModuleVisitState,GetModuleVisitState, etc.) to track the processing state of each module (processing, processed) in a dynamically-sized array.DownloadModuleto check and set module visit state before processing, skipping modules already processed or currently being processed (cycle detection), and logging appropriate messages.Consistent state finalization:
FinalizeModuleDownloadto update or remove module visit entries based on download results, ensuring state consistency even on error or early exit. All relevant exit points inDownloadModulenow call this function. [1] [2] [3] [4] [5]