Skip to content

Implement module visit tracking to prevent dependency cycles during downloads#300

Merged
JohnAmadis merged 1 commit into
developfrom
feature/fix-infinit-loop
May 29, 2026
Merged

Implement module visit tracking to prevent dependency cycles during downloads#300
JohnAmadis merged 1 commit into
developfrom
feature/fix-infinit-loop

Conversation

@JohnAmadis
Copy link
Copy Markdown
Contributor

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:

  • Introduced ModuleVisitEntry_t and related functions (FindModuleVisitEntry, SetModuleVisitState, GetModuleVisitState, etc.) to track the processing state of each module (processing, processed) in a dynamically-sized array.
  • Updated DownloadModule to 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:

  • Added FinalizeModuleDownload to update or remove module visit entries based on download results, ensuring state consistency even on error or early exit. All relevant exit points in DownloadModule now call this function. [1] [2] [3] [4] [5]

@JohnAmadis JohnAmadis self-assigned this May 29, 2026
@JohnAmadis JohnAmadis merged commit b1be787 into develop May 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant