Skip to content
Snippets Groups Projects

try to avoid `insert` races in `FederatedInstanceService`

Merged dakkar requested to merge feature/cope-with-insert-race-in-instanceservice into develop
All threads resolved!

What does this PR do?

Despite the cache, different processes can race to insert a row for the same remote host.

This is particularly apparent in our unit tests, with test/unit/activitypub.ts randomly failing.

This is a (somewhat clumsy) attempt at working around that race: trap the "duplicate key value" error, and fetch the record.

Tests pass, with or without values in the cache.

PLEASE DOUBLE CHECK MY LOGIC!

Contribution Guidelines By submitting this merge request, you agree to follow our Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
  • I have made sure to test this pull request

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Hazelnoot
  • dakkar resolved all threads

    resolved all threads

  • added bugbackend label

  • Hazelnoot approved this merge request

    approved this merge request

  • Marie approved this merge request

    approved this merge request

  • merged

  • Marie mentioned in commit 45974a53

    mentioned in commit 45974a53

  • Please register or sign in to reply
    Loading