Skip to content

TSM fanout waits until client timeout and returns 502 when some members return non-2xx responses #1056

Description

@tonychoe

Disclaimer: Used AI agent to diagnose the issue and write this report

Summary

With Trickster 2.0.4 (91f547433698f221094e03def7d9503c49d9d358), a TSM ALB query can wait until the caller’s timeout and return 502 when the fanout contains a mix of successful and non-2xx downstream responses.

The same PromQL succeeds when sent directly to healthy pool members. Downstream responses complete quickly, indicating that most of the delay occurs in Trickster’s fanout/gather path.

Setup

  • Trickster 2.0.4
  • Prometheus-compatible TSM ALB
  • Instant PromQL query
  • Large multi-backend pool
  • Mixed downstream results, including HTTP 200 and HTTP 401

Observed behavior

  • The TSM request produces no response headers before the client’s 90-second timeout.

  • The caller receives 502.

  • (CORRECTION: please disregard this line which was my mistake in testing) In one reproduction, a failing member returned HTTP 401 with no org id in approximately 0.2 seconds, while a working member returned HTTP 200 in approximately 0.34 seconds.

  • Despite these downstream responses completing quickly, the TSM request waited until the client timeout.

  • Representative Trickster logs include:

    • vector unmarshaling error
    • tsm gather merge failure: no timerange query
    • tsm gather failed due to nil func

Expected behavior

A failed or non-2xx pool member should not hold the entire TSM request until the client deadline.

If at least one member returns usable data, Trickster should return a bounded partial response with warnings. If no member contributes usable data, it should return an error promptly.

Related issue

This appears related to #1040 / #1041, but that fix is already included in the tested commit and seems focused on proxy-only/cache-range responses. The remaining case appears to involve instant queries with mixed successful and non-2xx member responses.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions