fix: report subscriptions actually created, not a flag-derived guess - #44
Open
fcostaoliveira wants to merge 1 commit into
Open
fix: report subscriptions actually created, not a flag-derived guess#44fcostaoliveira wants to merge 1 commit into
fcostaoliveira wants to merge 1 commit into
Conversation
TotalSubscriptions was computed as `total_channels * subscribers_per_channel`, but -subscribers-per-channel does not drive subscription creation. Fan-out comes from -clients x channels-per-connection, where channels-per-connection is set by -min/-max-number-channels-per-subscriber (both default 1). The reported figure and the real one share no terms. The consequence is worse than a wrong label. A caller reasonably reads "-subscribers-per-channel 10" as ten subscribers per channel -- the help text says exactly that -- and the output then confirms the belief with a number derived from the same inert flag. Nothing anywhere signals that the requested fan-out did not happen. Verified live: `-clients 50 -subscribers-per-channel 10` created 50 subscriptions and reported 1000. Three changes: * Count subscriptions as they are created and report that. The old value was derived from inputs, so it could never detect a mismatch between what was asked for and what happened. * Warn when an *explicit* -subscribers-per-channel went unmet, naming the flags that do control fan-out. Only when explicitly set: the default differing from the real count is normal and not the caller's doing, so warning there would be noise. * Fail loudly when subscribers-placement-per-channel is not "dense" in a subscribe mode. Only dense is implemented, and the branch had no else -- an unrecognised placement silently created zero subscribers and produced a clean zero-message result, which reads as "the server delivered nothing" rather than "we subscribed to nothing". total_messages is recomputed from the corrected count, so the -messages termination target is no longer derived from the unmet request. Verified against a live server: explicit-but-unmet warns and reports 50; correct fan-out reports 500 with no warning; a default run reports 20 with no warning; sparse placement now exits 1 with the reason. Refs #43
🐳 Docker Build Validation✅ Docker build successful! Platforms tested:
Git SHA: Docker Hub Status: ✅ Docker Hub credentials configured Image details:
Tests performed:
The Docker image is ready for deployment! 🚀 |
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.
Fixes #43.
TotalSubscriptionswastotal_channels * subscribers_per_channel, but-subscribers-per-channeldoes not drive subscription creation. Real fan-out is-clients× channels-per-connection, where channels-per-connection comes from-min/-max-number-channels-per-subscriber(both default 1). The reported number and the real one share no terms.The failure mode is the awkward kind: a caller reads
-subscribers-per-channel 10as ten subscribers per channel — the help text says exactly that — and the output then confirms the belief with a figure derived from the same inert flag. Nothing signals the request went unmet.Changes
-subscribers-per-channelgoes unmet, naming the flags that actually control fan-out. Gated on the flag being explicitly set (viaflag.Visit) — the default differing from the real count is normal and not the caller's doing, so warning there would just be noise on every run.denseplacement in subscribe modes. Onlydenseis implemented and the branch had noelse, so an unrecognised placement silently created zero subscribers and produced a clean zero-message result — which reads as "the server delivered nothing" rather than "we subscribed to nothing".total_messagesis recomputed from the corrected count, so the-messagestermination target no longer derives from the unmet request.Verified against a live server
TotalSubscriptions-subscribers-per-channel 10, unmet-subscribers-placement-per-channel sparseBefore this change, case 1 reported 1000.
Downstream
This is live in the benchmark spec: the
...-50K-subscribers-5k-connssuite passes exactly the case-1 arguments, so it generates the same 5000 subscriptions as its 5000-subscriber sibling. Fixed separately in redis/redis-benchmarks-specification#500 — that YAML fix and this one are independent and each correct on its own.I deliberately did not make
-subscribers-per-channelcontrol fan-out (option 1 in #43), since that changes behaviour for anyone currently passing it. Happy to do that instead if you'd prefer; this PR takes the option that only makes the reporting truthful.