Flux query timeout error reason differs between server logs and HTTP response on InfluxDB 2.x
0 reputation · 26 May 2020, 22:50 UTC
I'm working with InfluxDB 2.x and trying to handle timeouts and cancellation consistently across the HTTP query API and write path. My goal is to reliably distinguish a server-side max-query-time termination from a client-side cancellation or a write timeout, but the error surfaces don't seem to line up.
From what I can tell, a Flux query that exceeds the configured max-query-time is cancelled and returns a query-level error reason, while writes that surpass the write timeout return a different error whose exact message varies between the native /api/v2/write endpoint and client libraries. The HTTP status code and payload for a timed-out request also appear to depend on version and deployment settings, so I'm not sure which signal is authoritative.
My uncertainty is where to anchor the handling logic: the HTTP status code, the Flux error reason, or the server log entry, given that client libraries may mask or reinterpret the underlying timeout.
Specifically:
- Which field in the
/api/v2/queryresponse reliably identifies amax-query-timetermination versus a client-cancelled request? - Is the write timeout error from
/api/v2/writeguaranteed to carry a distinct status code from query timeouts in 2.x? - Should client-side handling trust the library's error type or always correlate with server logs?