-
Notifications
You must be signed in to change notification settings - Fork 17
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
🧹 batch sync assets #995
🧹 batch sync assets #995
Conversation
Signed-off-by: Ivan Milchev <[email protected]>
7be5579
to
fe16ac1
Compare
Signed-off-by: Ivan Milchev <[email protected]>
cnquery/cnspec and its providers are in general not thread safe and doing this will trigger data races. Not sure how to get this information for the providers, but you can at least see the data races fairly quickly for cnspec:
|
it looks like those are related to the |
Signed-off-by: Ivan Milchev <[email protected]>
The scans are now synchronous, batch size is 100 |
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.
LGTM Thanks @imilchev
I gave this a try with a container registry scan. Works as expected. |
Instead of calling
SynchronizeAssets
once for all discovered assets, we create batches. This makes sure that if we have discovered a huge amount of assets, the call would still succeed.I intentionally put a low number for the batch size because with this implementation, batches are scanned in parallel, which also decreases the total scan time.
Downside of this approach is that the progress bar results ordering is no longer deterministic. However, since this is a progress bar, I don't think ordering should matter