Project

General

Profile

Actions

Bug #27953

open

role / user updates fail with API when done in non-atomic fashion

Added by Will Foster over 4 years ago. Updated over 4 years ago.

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

Description

Using the Foreman API (1.19.1 up through 1.23) to change user passwords seem to fail when ran consecutively.

In QUADS (our scheduling framework for managing scale/perf Engineering labs) we perform this task via:

https://github.com/redhat-performance/quads/blob/master/quads/tools/foreman.py

Because we're calling asyncio the failures ultimately get recorded and re-queued until the successfully complete.

In our specific usage of the Foreman API everything else is not repeated (singleton), however there are times only with Foreman user password updates that may be run twice and these can fail.

With every set of tasks we see a certain number of failures for this specific task.

In working with Zhenech on #theforeman he can reproduce this also on a fresh 1.23 which results in a failure.

for i in $(seq 10); do curl -XPUT -k -u admin:changeme -H 'Content-Type: application/json' -d'{"user":{"role_ids":[12,13]}}' https://localhost/api/v2/users/5 & done
Actions

Also available in: Atom PDF