Commit 70af97d
Make trust_server_heartbeat read-timeout widening actually flow through to operation deadline
``DqliteProtocol._operation_deadline()`` keyed off
``self._timeout`` (the un-widened write-path budget) while
``_read_data`` then capped each chunk read at ``min(remaining,
self._read_timeout)``. Since the per-read cap was always
``>= remaining`` after the deadline calculation, the
heartbeat-trust widening of ``_read_timeout`` had NO effect
on the actual deadline budget — the documented
``trust_server_heartbeat=True`` opt-in was dead code on the
read deadline path.
Point ``_operation_deadline()`` at ``self._read_timeout`` so
the widening flows through. Write-path ``_send`` continues
to use ``self._timeout`` directly — only the read side gets
heartbeat extension.
Add a positive test pinning the now-real widening: a read
that takes longer than ``_timeout`` but less than the
widened ``_read_timeout`` completes cleanly. Updates the
sibling deadline test to set both ``_timeout`` and
``_read_timeout`` so the deadline reflects the test's
intended budget.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 991d02d commit 70af97d
2 files changed
Lines changed: 60 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
743 | 759 | | |
744 | 760 | | |
745 | 761 | | |
| |||
753 | 769 | | |
754 | 770 | | |
755 | 771 | | |
756 | | - | |
| 772 | + | |
757 | 773 | | |
758 | 774 | | |
759 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
158 | 200 | | |
159 | 201 | | |
160 | 202 | | |
| |||
0 commit comments