Skip to content

Fix: Prevent infinite loop in gap_analysis preload (#885)#895

Open
PRAteek-singHWY wants to merge 2 commits intoOWASP:mainfrom
PRAteek-singHWY:fix-gap-analysis-infinite-loop
Open

Fix: Prevent infinite loop in gap_analysis preload (#885)#895
PRAteek-singHWY wants to merge 2 commits intoOWASP:mainfrom
PRAteek-singHWY:fix-gap-analysis-infinite-loop

Conversation

@PRAteek-singHWY
Copy link
Copy Markdown
Contributor

Summary

This PR fixes an infinite loop bug in the gap_analysis.py background runner that could permanently lock up the application when checking standard pairings.

What Changed

  • Added a retry cap: Implemented a MAX_RETRIES = 10 threshold so failing pairs are correctly dropped from the waiting list instead of being retried endlessly.
  • Optimized list iteration: Replaced nested loops over string combinations with a direct list of Python tuples (sa, sb) to prevent redundant checking of already succeeded pairs.
  • Refined sleep logic: Added an if waiting: check to safely skip the unnecessary 30-second sleep on the final successful loop iteration.

fixes #885

@PRAteek-singHWY
Copy link
Copy Markdown
Contributor Author

Hi @Pa04rth, this PR resolves the infinite loop problem reported in #885. The issue has been solved by implementing a 10-retry cap for failing background jobs and optimizing the runner loop with tuples.
Happy to iterate if needed .

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.

Bug: Infinite loop in gap_analysis.py preload blocks background runner

1 participant