Skip to content

docs(server): say what the evict-on-full check actually tests - #1209

Open
astrogilda wants to merge 1 commit into
a2aproject:mainfrom
astrogilda:docs/evict-warning-names-what-the-check-tests
Open

docs(server): say what the evict-on-full check actually tests#1209
astrogilda wants to merge 1 commit into
a2aproject:mainfrom
astrogilda:docs/evict-warning-names-what-the-check-tests

Conversation

@astrogilda

Copy link
Copy Markdown
Contributor

Follow-up to #1137, documentation only. No behavior change: the diff touches two docstrings, one comment and one log format string. Ruff's linter and formatter are both clean on the two files, and the 73 tests in the event-queue and active-task modules pass.

#1137 added eviction so one sink whose queue has filled cannot wedge the dispatcher for every other subscriber. The behavior is right and the words around it are not. The guard is if sink._evict_on_full and sink.queue.full():, which tests queue fullness at delivery time and says nothing at all about the consumer. The docstring and the warning both described it as an abandoned subscriber whose consumer had stopped draining, which is a claim the check never makes. A consumer that is alive and reading steadily, merely max_queue_size events behind the dispatcher, satisfies the same predicate and is evicted the same way.

That gap costs an operator real time. The warning as written sends someone looking for a dead consumer, and what they will find is a live one that is slow, with nothing in the message saying that is expected. So the warning now says the queue was full at delivery time and that the sink is therefore at least max_queue_size events behind, and it states outright that this does not mean the consumer stopped reading.

Alongside it, the delivery docstring gains one paragraph saying what the test is and what it is not, the evict_on_full parameter doc names the queue bound rather than abandonment, and the comment at the subscriber tap site says the same thing. Abandonment stays where it is genuinely the subject: the teardown docstring still describes a producer wedged closing an abandoned sink, and the regression test still calls its never-drained sink abandoned, because in both of those cases that is what is happening.

The eviction predicate is queue fullness at delivery time. The docstrings
and the warning described it as an abandoned subscriber whose consumer
stopped draining, which is a claim about the consumer that the check never
makes: a consumer that is reading steadily but has fallen max_queue_size
events behind satisfies the same predicate and is evicted the same way.

Name the queue bound instead, and say explicitly that eviction does not
imply the consumer stopped reading, so an operator reading the warning
does not go hunting for a dead consumer and find a live one.

No behavior change.

Signed-off-by: Sankalp Gilda <sankalp.gilda@gmail.com>
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

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