Skip to content

Add cancellation check during repository download#301

Open
goelakshita708 wants to merge 1 commit into
ionfwsrijan:mainfrom
goelakshita708:fix-threading-cancel-event
Open

Add cancellation check during repository download#301
goelakshita708 wants to merge 1 commit into
ionfwsrijan:mainfrom
goelakshita708:fix-threading-cancel-event

Conversation

@goelakshita708

@goelakshita708 goelakshita708 commented Jul 9, 2026

Copy link
Copy Markdown

Linked issue

Closes #258

What this PR does

Adds a cancellation check inside the download_to_path() download loop. This allows long-running repository downloads to stop immediately when a cancellation request is received instead of continuing until the download finishes.

Type of change

  • Bug fix
  • New feature
  • ML model / training pipeline
  • Refactor (no behaviour change)
  • Documentation
  • Tests only

ML tier (if applicable)

  • Tier 1 — Triage
  • Tier 2 — Predictive
  • Tier 3 — Autonomous
  • Not ML-related

Stack affected

  • Backend
  • Frontend
  • Both

Changes

Backend

  • Added a cancellation check using cancel_event.is_set() inside the repository download loop in download_to_path().

Frontend

  • None.

New dependencies

  • None.

Database / schema changes

  • None.

Testing

How did you test this?

  • Verified the code change locally.
  • Confirmed the project builds without syntax errors.
  • Verified the cancellation check is executed during the download loop.

Checklist

  • Tested locally end-to-end (upload ZIP or GitHub URL → scan → findings returned correctly)
  • New ML model falls back gracefully when model file is absent
  • No new console.error or unhandled Python exceptions introduced
  • Added or updated tests where applicable
  • requirements.txt / package.json updated if new dependencies added
  • New model files (.pkl, .pt, etc.) are gitignored, not committed

Anything reviewers should focus on

Please review the cancellation behavior during repository downloads and verify that downloads stop promptly when a cancellation request is triggered.

Screenshots (if UI changed)

N/A (Backend change only)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎉 Thank you @goelakshita708 for submitting a Pull Request!

We're excited to review your contribution.

Before Review

✅ Ensure all CI checks pass
✅ Complete the PR template
✅ Link the related issue

Want faster reviews and contributor support?

Join our Discord community:

🔗 https://discord.gg/FcXuyw2Rs

Maintainers and mentors are active there and can help resolve blockers quickly.

Happy Contributing! 🚀

@github-actions github-actions Bot added SSoC26 needs-work Work needed backend Backend issues bug Something isn't working frontend Frontend issues and removed needs-work Work needed labels Jul 9, 2026
@github-actions github-actions Bot requested a review from arpit2006 July 9, 2026 14:48
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

@goelakshita708

Copy link
Copy Markdown
Author

Please add the GSSoC tag.
Thankyou.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

1 similar comment
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

@arpit2006

Copy link
Copy Markdown
Collaborator

@goelakshita708 , CI issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend issues bug Something isn't working frontend Frontend issues SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio.Event used across thread boundaries in cancellation mechanism - causes undefined behavior

2 participants