Reduce memory pressure of reliable response reception - #77
Merged
Conversation
…e that has seen reliable responses is discarded, do not keep it as a zombie but instead keep a much smaller 56-byte object behind to handle missed acks correctly.
pavel-kirienko
force-pushed
the
dev-zombie-compaction
branch
2 times, most recently
from
July 27, 2026 19:43
4c35d81 to
0e758fa
Compare
Test-only, except for a NULL guard in cy_topic_name(): - The intrusive fixtures crashed when built with CY_CONFIG_TRACE=1. Tracing calls cy_now() on every CY_TRACE, which publish_reliable left unset, and dereferences name indexes that reordering/topic_allocation left NULL on synthesized subscriber roots. A detached zeroed wkv_node_t suffices for the latter: wkv_get_key() terminates immediately on a parentless node. - cy_topic_name() dereferenced index_name unguarded. No production path reads a topic in that state, but it is reachable for synthesized objects. Verified: all 13 intrusive suites pass under -DCY_CONFIG_TRACE=1 with AddressSanitizer and UndefinedBehaviorSanitizer; default suite unchanged. Follow-ups from review, none changing behaviour on a reachable path: - Sample cy_now() before deindexing, avoiding a vtable call mid-teardown. - Drain retained ack records via the expiry list; every record is enlisted, and the trailing assertions then cover the tag tree instead. - Assert the two ack-record structures stay in lockstep, and that a fresh response is always acked. - Assert that request_ack_t and request_future_remote_t differ in size: the OOM tests select an allocation by its exact size, and the two collide on a 32-bit ABI that aligns uint64_t to 8. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pavel-kirienko
force-pushed
the
dev-zombie-compaction
branch
from
July 27, 2026 20:02
0e758fa to
6dd572d
Compare
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.
Reduce memory pressure of reliable response reception: once the future that has seen reliable responses is discarded, do not keep it as a zombie but instead keep a much smaller 56-byte object behind to handle missed acks correctly.