Skip to content

Add json error#25

Open
elad-ash wants to merge 2 commits into
masterfrom
add-json-error
Open

Add json error#25
elad-ash wants to merge 2 commits into
masterfrom
add-json-error

Conversation

@elad-ash

@elad-ash elad-ash commented Mar 30, 2017

Copy link
Copy Markdown
Contributor

Adding errors prints to JSON in case of exit(1) and cleaning debug prints from JSON file writing

fcostaoliveira added a commit that referenced this pull request Jun 2, 2026
…and tracking (#435)

* fix(resp3): accept push frames; count nil _ as miss in arbitrary command tracking

Two RESP3 correctness bugs surfaced by the 2.4 readiness review.

#27: aggregate_type() lacked '>'. A server-pushed message (pubsub,
keyspace notifications, client tracking invalidation) on a RESP3
connection hit the "unsupported response" path and dropped the
connection. Now accepts and drains push frames inline.

#25: SingleNullBulk and ArrayPerElementNulls miss sentinels only
recognised RESP2 nil shapes ($-1/*-1/*0). RESP3 nil (_\r\n) was
miscounted as a hit, silently understating miss rate and
suppressing --miss-rate-threshold warnings.

Refs: 2.4 review findings #25 + #27

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(resp3): flag RESP3 null at construction; distinguish from literal "_"

Bugbot flagged that the ArrayPerElementNulls walker used a content
heuristic (value_len==1 && value[0]=='_') that couldn't tell a
RESP3 null parsed via single_type from a real bulk value of literal
"_" parsed via blob_type. Both produce identical bulk_el.

Added bulk_el::is_resp3_null flag, set only when single_type
constructs the element for type byte '_'. Walker now reads the flag
directly instead of inferring from content. Test added that stores
"_" values and asserts they are NOT counted as misses.

Refs: bugbot LOW on PR #435

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(resp3): drain server-pushed frames without delivering as reply

Reviewer caught that the prior commit accepted RESP3 push (>) into
aggregate_type() but didn't suppress its effect on m_last_response.
The push frame fully parsed AS a reply, response_ended() returned 1,
and memtier dequeued the push as the reply to the next in-flight
command -- corrupting latency attribution + hit/miss accounting.

Adds an m_push drain-mode flag:
- Set when a push aggregate is encountered at top level
- Suppresses every mutation to m_last_response while true
- Cleared in response_ended(), which returns false so the parser
  continues to read the actual reply
- Reset on rs_initial transition

Refs: 2.4 review of PR #435 (R1 CRITICAL).

* fix(resp3): reset m_response_len when draining push frame

Bugbot caught that response_ended()'s m_push drain returned false
without resetting m_response_len. The accumulated push frame bytes
stayed in the counter and contaminated set_total_len() for the
actual reply, skewing bandwidth and per-op size statistics.

Resetting m_response_len to 0 at the push-drain-complete site
matches the behaviour at rs_initial (the only other site where
m_response_len is reset).

Refs: bugbot LOW on PR #435 (follow-up).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(resp3): clear both m_push and m_attribute together in response_ended()

Bugbot caught that if an attribute (|) appears nested inside a push
frame (>), and both complete at the same response_ended() call,
the m_attribute branch fired first and returned false, leaving
m_push set. The parser then consumed the actual command reply as
push-drain data, desynchronizing the connection.

response_ended() now clears whichever flags are set in a single
call and returns false if either was set.

Refs: bugbot LOW on PR #435 (follow-up).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant