Project

General

Profile

Actions

Bug #39204

closed

Remove redundant Candlepin pre-flight check and cache /rhsm/status response

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

Status:
Closed
Priority:
High
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

  1. Problem

Two sources of redundant Candlepin traffic during host registration:

1. check_registration_services pre-flight check

Fires a Katello::Ping.ping call against Candlepin before every POST /rhsm/consumers, DELETE /rhsm/consumers/:id, and the equivalent host_subscriptions endpoints. The check is redundant because:
- rescue_from RestClient::Exception already handles Candlepin failures and returns the actual HTTP error code
- register_host already cleans up partial Foreman DB state when Candlepin fails mid-registration
- subscription-manager independently calls GET /rhsm/status ~12 times per registration
- A Candlepin in maintenance mode returns non-200 from the registration endpoint anyway

2. /rhsm/status proxied to Candlepin on every call

subscription-manager calls GET /rhsm/status approximately 12 times per registration, all proxied to Candlepin /candlepin/status. Under 100 concurrent registrations this generates ~1200 Candlepin status calls competing with actual registration traffic.

  1. Fix

1. Remove check_registration_services entirely from both candlepin_proxies_controller and host_subscriptions_controller. The host_subscriptions_controller gains an explicit rescue_from RestClient::Exception that preserves 4xx semantics and returns 503 only for genuine backend unavailability.

2. Cache the /rhsm/status Candlepin response in server_status for 30 seconds using Rails.cache.fetch. The first call per window hits Candlepin; subsequent calls are served from cache. Under 100 concurrent registrations this reduces ~1200 Candlepin status calls to approximately 1 per 30-second window.


Related issues 1 (0 open1 closed)

Has duplicate Katello - Bug #39194: Candlepin availability check fires on every concurrent registration request causing excessive loadDuplicateActions
Actions #1

Updated by The Foreman Bot 3 months ago

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

Updated by Ian Ballou 3 months ago

  • Has duplicate Bug #39194: Candlepin availability check fires on every concurrent registration request causing excessive load added
Actions #3

Updated by Ian Ballou 3 months ago

  • Category set to Hosts
  • Target version set to Katello 4.21.0
  • Triaged changed from No to Yes
Actions #4

Updated by Ian Ballou 3 months ago

  • Assignee set to Pablo Méndez Hernández
Actions #5

Updated by The Foreman Bot 2 months ago

  • Fixed in Releases Katello 4.21.0 added
Actions #6

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

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

Updated by Ewoud Kohl van Wijngaarden 3 days ago

  • Red Hat JIRA set to SAT-43940
Actions

Also available in: Atom PDF