cloudnative-pg / cloudnative-pg/plugin-barman-cloud

Sidecar metrics collection over plugin gRPC has no deadline — one stuck operation hangs the whole instance /metrics

Abierto
#1,045 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Go
Estrellas
191
Forks
72
Merge medio
1 d 16 h
PR fusionados (30 d)
18

Descripción

## Environment

CloudNativePG 1.30.0, plugin-barman-cloud v0.14.0, PostgreSQL 17/18 clusters, VersityGW (posix) S3 endpoint.

## What happens

The instance sidecar collects plugin metrics over the plugin gRPC with **no deadline on the collect path**. Consequence: if any plugin operation gets stuck (in my case a retention/catalog-maintenance run that never completes against a posix-backend S3 gateway — filed separately), the next scrape blocks on the collector and the **entire** `/metrics` endpoint of that instance hangs indefinitely. Prometheus marks the target down and every metric of that instance disappears, not just the plugin's own collectors.

Observed in production: the primary instance's exporter dark for 6.7 hours while the database itself was healthy — WAL-archiver and backup-staleness alerting was blind precisely on the instance where it matters.

## Expected

- A per-collect deadline (a few seconds) on the plugin metrics gRPC call.
- On timeout/error: return the rest of the metrics plus an error counter (e.g. `..._collector_errors_total`), instead of hanging the whole endpoint. A misbehaving plugin should degrade its own metrics, never the instance's.

## Reproduction sketch

1. ObjectStore against VersityGW (posix backend) with any `retentionPolicy` set.
2. Wait for a retention run to start (~30 min cadence) — it never completes against this backend.
3. Scrape the instance sidecar's metrics port: the request hangs until the client gives up; `up` goes to 0 for the instance.

Companion issue describes the retention hang itself; this one is about the missing deadline that turns any such hang into a full metrics outage.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Rastrea la ruta de collect de métricas gRPC del plugin del sidecar de instancia y reproduce el problema con una operación del plugin atascada; después, inspecciona cómo el endpoint /metrics gestiona los errores del collector. Verifica que un tiempo de espera por collect permita al endpoint devolver las métricas restantes y registrar un error cuando la llamada al plugin se quede bloqueada, mientras las métricas del plugin que funcionan correctamente siguen funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
go, grpc
Área
backend, observability
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.