Skip to content

Add configurable serialized-payload limits with fail-open oversize behavior #36

Description

@lan17

Priority

P1 — High — resolve before broad production adoption or large-scale use.

Problem

Redis values have no size ceiling. DialCache serializes and sends the full payload, and Lua loads, slices, or concatenates the entire value on Redis's main thread.

Evidence:

The review measured roughly 660 µs for a 1 MiB Lua read versus 34 µs for raw GET, and roughly 557 µs for a 1 MiB Lua write versus 2.5 µs for raw SET on the tested Redis 6.2 setup.

Open decisions

Approve whether the limit is global, per definition, or both; whether it has a default; and whether an oversize remote value may still enter local cache.

Acceptance criteria

  • Measure exact UTF-8 or Buffer bytes after serialization.
  • Never send an oversized value to Redis.
  • Preserve documented fail-open behavior.
  • Emit a bounded-cardinality oversize outcome and sampled warning.
  • Test multibyte strings, Buffers, exact boundaries, and serializer failures.
  • Document the event-loop and Redis-main-thread rationale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions