Project

General

Profile

Actions

Bug #37785

closed

Container push sometimes makes duplicate repos due to race condition

Added by Samir Jha 3 months ago. Updated 2 months ago.

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

Description

Description of problem:

Seemingly randomly, sometimes a container push results in two repositories being created, which fails the push with the "Its Container Repository Name (%{container_name}) conflicts with an existing repository." error.

This is due to a race condition. Since APIs are called simultaneously, I was able to catch two puma workers both reaching https://github.com/katello/katello/blob/master/app/controllers/katello/api/registry/registry_proxies_controller.rb#L346 at the same time.

The get_root_repo_from_product check returns true for both workers, so two repositories get created. We need to figure out how to synchronize the simultaneous requests.

How reproducible:

Sometimes, it's a race condition.

Is this issue a regression from an earlier version:

No.

Steps to Reproduce:

1. Stick a debugger before the `get_root_repo_from_product` line in `create_container_repo_if_needed`.

2. Push Quay's prometheus/busybox image

3. In the debugger, see that two separate workers both reach the same line of code. This is an indication that there's a race condition – it's possible that the repository will not be created yet for either.

Actual behavior:

An error about the container repo name conflicting is thrown.

Expected behavior:
The container image is pushed without error.

Actions #1

Updated by The Foreman Bot 3 months ago

  • Status changed from New to Ready For Testing
  • Assignee set to Samir Jha
  • Pull request https://github.com/Katello/katello/pull/11129 added
Actions #2

Updated by Jeremy Lenz 3 months ago

  • Target version changed from Katello 4.14.1 to Katello 4.14.0
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot 3 months ago

  • Fixed in Releases Katello 4.15.0 added
Actions #4

Updated by Samir Jha 3 months ago

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

Updated by The Foreman Bot 2 months ago

  • Fixed in Releases Katello 4.14.1 added
Actions #6

Updated by The Foreman Bot 2 months ago

  • Pull request https://github.com/Katello/katello/pull/11162 added
Actions

Also available in: Atom PDF