-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(scans): scheduled scans duplicates #9829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(scans): scheduled scans duplicates #9829
Conversation
|
✅ All necessary |
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
10 package(s) affected
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9829 +/- ##
==========================================
+ Coverage 86.60% 92.16% +5.56%
==========================================
Files 222 180 -42
Lines 5645 24808 +19163
==========================================
+ Hits 4889 22865 +17976
- Misses 756 1943 +1187
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| provider_id=provider_id, | ||
| task__task_runner_task__task_id=task_id, | ||
| ).order_by("completed_at") | ||
| ).first() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to order it by completion time? I assume not but I can't see why.
| ): | ||
| # Duplicated task execution due to visibility timeout or scan is already running | ||
| if executed_scan: | ||
| # Duplicated task execution due to visibility timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Don't we need to increase it for this kind of tasks?
- Is the message being re-queued?
Context
When scans are running for more than 24 hours, more than one scheduled scan can be created for the same provider, leading to unexpected behaviors and errors.
Description
With this approach, no more than one scheduled scan can be run in the same day for the same provider.
Also, when the scheduled scan task is triggered, it will take care of duplicates to clean the tenant.
Note
Locally, more than one scheduled scans were forced under the same provider. After triggering the perform scheduled scan task, the duplicated scheduled scan was deleted and the scan was properly run.
Steps to review
Please add a detailed description of how to review this PR.
Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.