Project

General

Profile

Bug #25366

http_proxy code does not return db connection to pool quickly enough

Added by Stephen Benjamin about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

It seems a change in Satellite 6.3.3 introduced a strange issue with regards to incomplete/missing repositories from a repository-set. This does not appear to be an issue with the manifest itself.

As an example, in the WebUI this would translate to [Content]->[Red Hat Repositories]->[RPMs]->[Red Hat Enterprise Linux 6 Server (RPMs)]

Once expanded, there are repositories which are missing. To better illustrate this, hammer output shows something like the following:

$ hammer repository-set available-repositories --product-id 148 --id 168

-----------------------------------------|--------|---------|---------------|--------
NAME | ARCH | RELEASE | REGISTRY NAME | ENABLED
-----------------------------------------|--------|---------|---------------|--------
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.1 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.1 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.10 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.10 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.4 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.4 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.5 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.5 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.6 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.6 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6.7 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6.7 | | no
Red Hat Enterprise Linux 6 Server (RPMs) | x86_64 | 6Server | | no
Red Hat Enterprise Linux 6 Server (RPMs) | i386 | 6Server | | no
-----------------------------------------|--------|---------|---------------|--------

Notice the missing releases 6.2, 6.3, 6.8, 6.9...

Subsequent requests at refreshing the available repositories may show that releases that were missing appear, while those that previously appeared disappear and vice versa. In any case, one can imagine that this is a huge inconvenience to say the least.

Version-Release number of selected component (if applicable):

Satellite 6.3.3

How reproducible:

Always.

Steps to Reproduce:

1. Import the attached manifest (or any manifest really)
2. List available repositories to be enabled via WebUI or hammer:

$ hammer repository-set available-repositories --product-id 148 --id 168

3. Observe incomplete/missing repositories

Actual results:

Incomplete/missing repositories.

Expected results:

No incomplete/missing repositories.

Additional info:

Tentative workaround available in the comments.

Associated revisions

Revision ed5adda4 (diff)
Added by Stephen Benjamin about 1 month ago

fixes #25366 - make http_proxy monkey patch work multithreaded

In Katello, we use concurrent-ruby to kick off a bunch of Net::HTTP
requests, but unfortunately what happens is we quickly run out of
connections from the database pool. After banging my head against this
for a while, and trying all kinds of crazy things like wrapping the
Setting accesses in a mutex - it occured to me that this code isn't
causing the connection to be returned to the pool automationally since
we're outside of ActiveRecord. It takes some time for connection to be
reclaimed.

By wrapping this in a with_connection block, the connection is returned
to the pool immediately when done and allows Foremans' monkey patching
to work with multiple threads in Katello.

History

#1 Updated by The Foreman Bot about 1 month ago

  • Assignee set to Stephen Benjamin
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6196 added

#2 Updated by Tomer Brisker about 1 month ago

  • Subject changed from http_proxy code does not return db connection to pool quickly enough to http_proxy code does not return db connection to pool quickly enough
  • Fixed in Releases 1.21.0 added

#3 Updated by Stephen Benjamin about 1 month ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF