Commit 9e0a756
Fix WS per-endpoint token pull and getToken doc
QwpWebSocketSender.buildAndConnect resolved the Authorization header
inside its per-endpoint walk, so a token provider was queried once per
endpoint per reconnect round. A throwing provider (a failed silent
refresh, or not signed in) was then caught as a per-endpoint transport
error, retried across every endpoint, and surfaced as "all endpoints
unreachable" - masking the real auth failure and re-hammering the token
endpoint with the same dead credential.
Resolve the header once per (re)connect round, before the endpoint walk,
and reuse it across a failover (a token is cluster-wide). A provider
throw now propagates to connectWithRetry, which retries it within the
reconnect budget - the documented streaming model - and surfaces the
provider's own message. A close that races the round aborts before the
possibly blocking token pull. This mirrors QwpQueryClient, which
likewise resolves the credential once before its walk.
Add a WebSocketTokenProviderTest case that proves the provider is
queried once (not per endpoint) and its error surfaces instead of
"all endpoints unreachable"; it fails against the pre-fix code.
Also correct the OidcDeviceAuth.getToken() javadoc: the silent refresh
is not bounded by httpTimeoutMillis end to end. That timeout bounds the
send, response wait and body parse, but the preceding connection phase
(DNS, TCP connect, TLS handshake) is bounded by the OS, so an
unreachable token endpoint can stall the refresh for the OS TCP-connect
timeout (~2 minutes), not 30s. The class already documented this for
the token-store lock; the getToken() contract now matches.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2ce1ca0 commit 9e0a756
3 files changed
Lines changed: 77 additions & 15 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass
- auth
- qwp/client
- test/java/io/questdb/client/test/cutlass/qwp/client
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
477 | 482 | | |
478 | 483 | | |
479 | 484 | | |
| |||
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
2433 | 2434 | | |
2434 | 2435 | | |
2435 | 2436 | | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
2436 | 2453 | | |
2437 | 2454 | | |
2438 | 2455 | | |
| |||
2451 | 2468 | | |
2452 | 2469 | | |
2453 | 2470 | | |
2454 | | - | |
2455 | | - | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
2459 | 2474 | | |
2460 | 2475 | | |
2461 | 2476 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
138 | 180 | | |
139 | 181 | | |
140 | 182 | | |
| |||
0 commit comments