Commit 64dd95b
committed
fix(qwp): reject reconnect_max_duration_millis = 0 -- a zero budget can never work
The builder accepted >= 0, but 0 is a value with no working semantics:
- SYNC initial connect: connectWithRetry's deadline (startNanos + 0)
expires before the first attempt, so build() throws "failed after
0ms / 0 attempts" without ever dialing -- even against a healthy
server. Worse, explicitly setting any reconnect_* knob implicitly
promotes the initial-connect mode to SYNC, so writing =0 made the
instant failure the guaranteed outcome, not an edge case.
- Background drainer: capabilityGapBudgetNanos = 0 makes the durable-ack
settle budget exhaust on the first gap sweep (0 >= 0), quarantining
the slot instantly instead of after the documented 16-sweep budget.
No consumer treats 0 as a disabled/infinite sentinel (the background
reconnect loop ignores this knob entirely under Invariant B), so nothing
loses expressible behavior. Validation sits in the builder setter -- the
single choke point for the builder, config-string, and view paths --
matching the > 0 contract of the sibling backoff knobs.
Tests cover zero and negative through both the config string and the
builder.1 parent 21fe8cb commit 64dd95b
2 files changed
Lines changed: 41 additions & 3 deletions
File tree
- core/src
- main/java/io/questdb/client
- test/java/io/questdb/client/test/cutlass/qwp/client
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2469 | 2469 | | |
2470 | 2470 | | |
2471 | 2471 | | |
2472 | | - | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2473 | 2477 | | |
2474 | 2478 | | |
2475 | 2479 | | |
2476 | 2480 | | |
2477 | 2481 | | |
2478 | | - | |
2479 | | - | |
| 2482 | + | |
| 2483 | + | |
2480 | 2484 | | |
2481 | 2485 | | |
2482 | 2486 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
927 | 961 | | |
928 | 962 | | |
929 | 963 | | |
| |||
0 commit comments