Commit 18fcae7
Add max_blob_size caller hook to encode_blob / decode_blob
The 16 MiB ``_MAX_BLOB_SIZE`` was a module-level constant with no
override path. A deployment with a larger
``raft.log.entry_size_max`` (rare but legitimate) had no way to
read or write blobs above the cap short of monkey-patching the
module. Add an optional ``max_blob_size`` kwarg to both
``encode_blob`` and ``decode_blob``, defaulting to the module
constant so existing callers see no behaviour change. Advanced
callers (mock servers, bespoke decode pipelines) can now raise or
lower the cap explicitly.
End-to-end plumbing through ``decode_value`` /
``decode_params_tuple`` / ``MessageDecoder`` / ``DqliteConnection``
is deferred — adds ~30 call-sites for a feature whose caller demand
is currently zero. The wire-layer hook is the minimum change that
unblocks the "caller cannot override the cap" complaint; future
end-to-end plumbing builds on it without re-litigating the API.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ee068c6 commit 18fcae7
2 files changed
Lines changed: 62 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
316 | 323 | | |
317 | 324 | | |
318 | | - | |
319 | | - | |
| 325 | + | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
324 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
325 | 334 | | |
326 | 335 | | |
327 | 336 | | |
328 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
329 | 341 | | |
330 | 342 | | |
331 | 343 | | |
332 | 344 | | |
333 | 345 | | |
334 | | - | |
335 | | - | |
| 346 | + | |
| 347 | + | |
336 | 348 | | |
337 | 349 | | |
338 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments