Skip to content

Race condition between suggestion creation and caching #829

@fricklerhandwerk

Description

@fricklerhandwerk

We occasionally get an error of the sort

RelatedObjectDoesNotExist at /suggestions/untriaged/
CVEDerivationClusterProposal has no cached.

This seems to happen because suggestions are listed as soon as they're created, but the cached value is only created with some delay. So when someone accesses a list view with an uncached suggestion in it, they get a 500. This is a minor annoyance, but we just shouldn't have that sort of random outage.

The immediate fix is straightforward: Make the view list cached values only.
It gets a bit trickier when taking notifications into account. Those are created right after the suggestions, and notifications link to detail views on the suggestion. Probably the notification should only trigger when the cached value arrives, because only then it's safe to link to a view. We may even end up requiring the cached value to display the notification itself (e.g. to already show the subscribed packages affected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendsomething the web server needs to provide the frontend withbugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions