Project

General

Profile

Actions

Bug #39226

closed

Fix RHSM OS race condition reintroduced by recent refactor

Added by Pablo Méndez Hernández 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Fixed in Releases:
Found in Releases:

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.

Actions #1

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)
Actions #2

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
Actions #3

Updated by Pablo Méndez Hernández 3 months ago

  • Red Hat JIRA set to SAT-43299
Actions #4

Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 3.19.0 added
Actions #5

Updated by Anonymous 3 months ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/10969 added
Actions

Also available in: Atom PDF