Commit 82b8bab
Fix OIDC cancelRow crash and SF drainer terminal
The httpTokenProvider work introduced two defects.
cancelRow() could segfault the JVM. With a provider configured,
newRequest() defers the token and leaves the request at the header
stage, so contentStart stays at its -1 sentinel and no row bytes are
buffered. cancelRow() then ran trimContentToLen(0), which set the
write pointer to -1, and the next buffer write faulted in
Unsafe.putByte. cancelRow() now returns early while the token is
pending (nothing is buffered yet), and trimContentToLen refuses the
-1 sentinel as a defensive guard.
The store-and-forward background drainer could terminate a producer on
a transient credential outage. It bounded a token-provider failure by
reconnect_max_duration_millis and then latched a SECURITY_ERROR
terminal, dropping a producer that store-and-forward had promised to
keep alive. A failing provider (IdP unreachable, a silent refresh
failing, an interactive sign-in in progress) is a transient outage
like any other, so the running drainer now retries it indefinitely
with capped backoff, per Invariant B. The foreground/SYNC initial
connect still fails fast, because a connectivity error is only the
caller's problem during initialization. This restores the file's own
field comment, which already declared reconnect_max_duration_millis
"NOT consulted by the background loop".
The crash gets a regression test proven to segfault without the guard.
The drainer tests now assert the sender survives a persistent provider
outage and recovers, replacing a catch-all that asserted nothing about
the terminal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 82ae4af commit 82b8bab
5 files changed
Lines changed: 149 additions & 106 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass
- http/client
- line/http
- qwp/client/sf/cursor
- test/java/io/questdb/client/test/cutlass
- line
- qwp/client
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
551 | 558 | | |
552 | 559 | | |
553 | 560 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
472 | 481 | | |
473 | 482 | | |
474 | 483 | | |
| |||
Lines changed: 23 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1153 | 1151 | | |
1154 | 1152 | | |
1155 | 1153 | | |
| |||
1170 | 1168 | | |
1171 | 1169 | | |
1172 | 1170 | | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | 1171 | | |
1179 | 1172 | | |
1180 | 1173 | | |
| |||
1271 | 1264 | | |
1272 | 1265 | | |
1273 | 1266 | | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1310 | 1277 | | |
| 1278 | + | |
1311 | 1279 | | |
1312 | | - | |
1313 | | - | |
| 1280 | + | |
| 1281 | + | |
1314 | 1282 | | |
1315 | 1283 | | |
1316 | 1284 | | |
1317 | 1285 | | |
1318 | 1286 | | |
1319 | | - | |
1320 | 1287 | | |
1321 | 1288 | | |
1322 | 1289 | | |
| |||
1355 | 1322 | | |
1356 | 1323 | | |
1357 | 1324 | | |
1358 | | - | |
1359 | 1325 | | |
1360 | 1326 | | |
1361 | 1327 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
90 | 133 | | |
91 | 134 | | |
92 | 135 | | |
| |||
0 commit comments