Actions
Bug #39226
closedFix RHSM OS race condition reintroduced by recent refactor
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Description
A recent refactor replaced `create_or_find_by` with `create` in RhsmFactParser#operatingsystem, re-introducing a race condition that had previously been fixed. Under concurrent bulk registration, multiple hosts try to create the same OS record simultaneously, causing PG::UniqueViolation on index_operatingsystems_on_title.
Fix: restore `create_or_find_by` (atomic insert with conflict fallback) and use `find_by_attributes` (the multi-constraint lookup introduced by the same refactor) as the last-resort fallback — combining the best of both fixes.
Updated by Pablo Méndez Hernández 3 months ago
- Subject changed from Fix RHSM OS race condition reintroduced in #38930 to Fix RHSM OS race condition reintroduced by recent refactor
- Description updated (diff)
Updated by The Foreman Bot 3 months ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/10955 added
Updated by Anonymous 3 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|d296695fc2f032834d9c1f51c0d4165b3f6d4202.
Updated by The Foreman Bot 3 months ago
- Pull request https://github.com/theforeman/foreman/pull/10969 added
Actions