Conversation
…rors XPENDING <key> <group> on an empty PEL replies [0, nil, nil, nil] (src/t_stream.c:3069-3072), but src/commands/xpending.json only described non-empty summaries, so reply-schemas-validator rejected a valid reply. This adds the empty-summary oneOf branch (backport of #4653) and a test that exercises it under --log-req-res. Separately, utils/req-res-log-validator.py re-raised the jsonschema ValidationError from inside a multiprocessing pool worker. That exception holds a TypeChecker lambda in jsonschema._types, which cannot be pickled, so the parent reported MaybeEncodingError/PicklingError instead of the schema mismatch. Raise a plain RuntimeError carrying the message instead. Signed-off-by: Madelyn Olson <matolson@amazon.com>
This was referenced Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XPENDING <key> <group>on a consumer group with an empty pending entries list replies[0, nil, nil, nil](src/t_stream.c:3069-3072), butsrc/commands/xpending.jsononly described non-empty summaries, soreply-schemas-validatorrejected a valid reply and failed the Daily run. The second, unrelated problem is that when any schema mismatch happens,utils/req-res-log-validator.py:239re-raised thejsonschema.ValidationErrorfrom inside amultiprocessing.Poolworker; that exception holds aTypeCheckerlambda injsonschema._typesand cannot be pickled, so the parent reportedMaybeEncodingError: ... PicklingErrorand the real error was only visible 650 lines earlier in the log. This adds the empty-summaryoneOfbranch (backport of valkey-io/valkey#4653) plus a test that exercises it under--log-req-res, and raises a plainRuntimeErrorcarrying the message so the validator's exit reports the actual mismatch.Fixes #49. Schema half is a backport of valkey-io/valkey#4653; the validator masking is still present at
upstream/unstable.Details
Problem 1: schema does not describe the empty-PEL reply
src/t_stream.c:3064-3072:The summary branch of
reply_schemadeclareditems[1]anditems[2]astype: stringwithpattern: [0-9]+-[0-9]+anditems[3]astype: array. Nothing accepted nulls, so[0, None, None, None]matched neitheroneOfbranch.Before this change, no test on this branch called the two-argument form on an empty PEL. The only bare call is
tests/unit/type/stream-cgroups.tcl:97, and its PEL has four entries. Upstream first hit this when valkey-io/valkey#4629 added such calls attests/unit/type/stream.tcl:777and:799, which is why exactly one Daily run failed.Problem 2: the validator hides its own error
utils/req-res-log-validator.py:186process_fileruns in the pool created at:334. On mismatch,:230-239printed diagnostics and thenraised thejsonschemaexception. Reproduced standalone with the pinnedjsonschema==4.17.3:This is not specific to XPENDING. Every reply-schema mismatch presents the same way, which is why automated fingerprinting of the failing run found no signature. Contrast valkey-io/valkey#2676, where the worker raised a
ValueErrorand the parent reported it verbatim.Alternative rejected
sys.exit(1)in the handler raisesSystemExit, aBaseException.multiprocessing.pool.workeronly catchesException, so the worker would die without sending a result andpool.mapcan block.RuntimeError(str(err))propagates through the pool normally and preserves the message. The fulljsonschemadiagnostics were already printed by:231-238and are unaffected.Testing
Built with
make SERVER_CFLAGS='-Werror -DLOG_REQ_RES', ran./runtest --single unit/type/stream-cgroups --log-req-res --force-resp3 --dont-clean, then./utils/req-res-log-validator.py.Without either fix, with the new test present, both defects show at once. The validator exits 1, and the tail is the misleading error:
The real cause was 46 lines earlier:
With only the validator fix applied and the old schema still in the binary, the same logs produce the real error at the tail:
With both fixes, the validator exits 0 and reports
xpending: 33hits.This was generated by AI but verified, with love, by a human.