Commit 45f4ae5
Send keepalive PINGs when waiting on durable-ack confirmations
The server's QWP egress only runs flushPendingAck on inbound recv
events: handleBinaryMessage, handlePing, close. Without inbound
traffic from the client, an idle connection that has finished
publishing its data sits forever waiting for STATUS_DURABLE_ACK
frames that the server has the data for but no event-loop trigger
to send.
The legacy QwpWebSocketSender exposed a ping() API for the same
purpose; the SF cursor sender is supposed to be opaque to the user,
so put the prod inside the I/O loop. When durableAckMode is on and
pendingDurable is non-empty, the loop sends a WebSocket PING every
200ms while otherwise idle. The throttle bounds the cost at one PING
per 200ms per opted-in connection, only while actually waiting on
acks. The ping resets on reconnect via clearDurableAckTracking() so
a fresh connection can prod the server immediately.
This is a stopgap. The right server-side fix is for the egress
processor to flush durable-ack frames on its own schedule -- either
a per-connection idle tick or a registry-driven wake of the affected
connection's event loop. Both require touching the HTTP server
framework's dispatch model. The client-side keepalive lets the
durable-ack tests on vi_sf pass without that work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent de8ba19 commit 45f4ae5
1 file changed
Lines changed: 53 additions & 0 deletions
File tree
- core/src/main/java/io/questdb/client/cutlass/qwp/client/sf/cursor
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
| |||
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
152 | 169 | | |
153 | 170 | | |
154 | 171 | | |
| |||
813 | 830 | | |
814 | 831 | | |
815 | 832 | | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
816 | 837 | | |
817 | 838 | | |
818 | 839 | | |
| |||
862 | 883 | | |
863 | 884 | | |
864 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
865 | 894 | | |
866 | 895 | | |
867 | 896 | | |
| |||
941 | 970 | | |
942 | 971 | | |
943 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
944 | 997 | | |
945 | 998 | | |
946 | 999 | | |
| |||
0 commit comments