Azure / Azure/data-api-builder
[Bug]: Critical! GraphQL health checks are consistently slower than REST checks
- Langage dominant
- C#
- Étoiles
- 1.5k
- Forks
- 370
- Merge moyen
- 3 j 22 h
- PR mergées (30 j)
- 9
Description
GraphQL entity health checks consistently take 1.5-2x longer than REST checks for the same entity, leading to false `Unhealthy` results when thresholds are set based on expected query time.
## Expected
Health checks for the same entity should have comparable response times regardless of the API surface (REST vs GraphQL), since both execute the same underlying SQL query.
## Actual
Observed across multiple test runs:
| Entity | REST (ms) | GraphQL (ms) | Ratio |
|--------|-----------|-------------|-------|
| Todo | 254-306 | 553-663 | ~2x |
| User | 255-306 | 552-663 | ~2x |
| Category | 237-306 | 570-663 | ~2x |
| Product | 306 | 663 | ~2x |
This means a `threshold-ms: 500` that comfortably passes REST checks will fail GraphQL checks on first call, making the overall health status `Unhealthy` despite the database being fine.
**Root cause:** The health check implementation makes real HTTP calls to its own REST and GraphQL endpoints. GraphQL has additional overhead (Hot Chocolate query pipeline, parsing, validation, resolver execution) compared to REST's direct controller action.
**Impact:** Users setting thresholds based on database query performance will see unexpected `Unhealthy` status. The `threshold-ms` effectively needs to account for the full middleware + framework overhead, not just DB time.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez les vérifications de santé des entités Todo, User, Category et Product via REST et GraphQL, en utilisant la même valeur de threshold-ms. Suivez les véritables appels HTTP de l’implémentation de la vérification de santé vers les endpoints REST et GraphQL, puis comparez la surcharge du middleware et du pipeline de requêtes. La tâche est terminée lorsque des vérifications équivalentes ne produisent plus de résultats Unhealthy erronés uniquement en raison de la surface de l’API.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp, graphql
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100