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

Fix NVD API's last modified timestamp requiring restart to be applied #3322

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Dec 18, 2023

Description

Fixes an issue that caused the "last modified" timestamp for NVD mirroring via REST API to not be effective, unless the application is restarted.

Addressed Issue

#3293 (comment)

Additional Details

The timestamp is created with value null in a context where L2 caching is enabled (DefaultObjectGenerator), but updated in one where L2 caching is disabled (NistApiMirrorTask#updateLastModified). What's more, it's queried in a context with L2 caching enabled (NistApiMirrorTask#inform). This causes the property to be updated, but the cache not being invalidated, thus still serving queries.

To not have similar inconsistencies in other areas of the application, re-enable L2 caching when updating the property.

Eventually, L2 caching should be disabled system-wide.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

The timestamp is created with value `null` in a context where L2 caching is enabled (`DefaultObjectGenerator`), but updated in one where L2 caching is disabled (`NistApiMirrorTask#updateLastModified`). What's more, it's queried in a context with L2 caching enabled (`NistApiMirrorTask#inform`). This causes the property to be updated, but the cache not being invalidated, thus still serving queries.

To not have similar inconsistencies in other areas of the application, re-enable L2 caching when updating the property.

Eventually, L2 caching should be disabled system-wide.

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro added the defect Something isn't working label Dec 18, 2023
@nscuro nscuro added this to the 4.11 milestone Dec 18, 2023
@nscuro nscuro merged commit 23621ea into DependencyTrack:master Dec 18, 2023
8 checks passed
@nscuro nscuro deleted the fix-nvdapi-lastmodified-ts branch December 18, 2023 21:04
@nscuro nscuro mentioned this pull request Dec 19, 2023
2 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
defect Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant