Project

General

Profile

Actions

Bug #33747

open

Concurrent fact uploads for a non-existing host may lead to duplicate host records being created

Added by Adam Ruzicka over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Facts
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When uploading facts for a non-existent host, we seem to create a new host, but save it after importing its facts. This opens quite a large window during which additional fact upload for the same host could happen.

Reproducer details (assumes running on a foreman machine foreman-ansible, although it is reproducible with anything that uploads facts):

# playbook.yml
---
- hosts: all
  tasks:
    - setup:

Run with

for i in `seq 5`; do
  sudo -u foreman-proxy ansible-playbook -i ,duplicate-host -c local playbook.yml &
done

On my machine, this managed to create anything from 1 to 5 instances of duplicate-host.

Actions

Also available in: Atom PDF