Skip to content
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

Check feed status without acquiring lock #1266

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Aug 20, 2020

The feed versions / timestamps are now checked without acquiring the lock on the lockfile first so the check does not appear as an update in progress.
This check and handling the actual updates is also done in a forked process now so the scanner taking longer to respond with the feed version does not block the main process.

Checklist:

Acquiring the file lock when checking if the feeds are current can make
it appear as if an update is in progress, so the checks are first
performed before attempting to acquire the lock.
This makes it simpler to get the feed version from the scanner without
comparing it to the database version.
This way the main process is not blocked if part of the version check
like getting the VTs feed version from the scanner takes longer to
complete.
@timopollmeier timopollmeier marked this pull request as ready for review August 20, 2020 15:35
The feed type must be either "cert" or "scap" and the database check
must use the correct type.
Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pity that things get more complex, but seems sensible.

@mattmundell mattmundell merged commit bc5f9ac into greenbone:gvmd-20.08 Aug 24, 2020
@timopollmeier timopollmeier deleted the check-feed-status-outside-lock-20.08 branch October 15, 2021 10:14
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.

2 participants