Bug #39204
closedRemove redundant Candlepin pre-flight check and cache /rhsm/status response
Description
- 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.
- 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.
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
Updated by Ian Ballou 3 months ago
- Has duplicate Bug #39194: Candlepin availability check fires on every concurrent registration request causing excessive load added
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
Updated by Pablo Méndez Hernández 2 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|4020849f915560ad464d2280988b9d2eb005d49c.