Repository navigation
Adds Statifier.report_send_failed for a send a host could not deliver - #23
Merged
Merged
Conversation
A host whose processor cannot deliver a send it was handed now tells the chart, which takes error.communication with the send's id, as the reference's Statifier.Session.failed_send/3 writes it: the event's origin is the send's content and its sendid is the send's id whether or not the author named it. The report runs the chart to a stable configuration and then takes its external queue, as a step does. It is refused with :not_running once the chart has stopped and with :halted while a round budget has halted it, where the reference's session drops the report. A processor that knows of the failure while it is handed the send answers Statifier::Driver::DeliveryFailure from deliver, and the same event is raised within that call, at the send's place, as the reference raises the failure its processor plans in deliver/3. Such a failure counts against the call's round budget, so a chart that sends again on every failure halts. The conformance runner reports a send whose expected item asks for it once the call that handed it returns, before the configuration is read, and the ratchet records statifier/send/registered_send_failed. Refs: srb-1xq
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.
Bead: srb-1xq
What
Statifier.report_send_failed(machine, state, send, **options)lets a host tell a chart that a send it was handed could not be delivered. The chart takeserror.communicationon its internal queue, as the reference'sStatifier.Session.failed_send/3writes it (statifier-ex atv2.16.0,lib/statifier/session.ex): the event's origin is the send's content, itssendidis the send's id whether or not the author named it, and it carries no data. The chart then runs to a stable configuration and takes its external queue, asStatifier.stepdoes. The result has the shape of the driver's other calls (ok?,value,error), its value aStatifier::Driver::Moved.:not_running; while a macrostep's round budget has halted it, with:halted. Nothing is written in either case, as the reference's session drops a report to a sender halted:done,:cancelledor:budget_exhausted.reason:(the host's own account; not read, and the chart is not handed it, as the reference does not readfailure),processors:andclock:. An unknown option, a state that is not an execution ofmachine, or processors naming other types raiseArgumentError; a machine, state or send of the wrong kind raisesTypeError.delivermay answerStatifier::Driver::DeliveryFailure.new(reason:), and the same event is raised within the call that handed the send, at its place, as the reference raises the failure its processor plans indeliver/3(the Basic HTTP processor's no-target clause inlib/statifier/send/basic_http.ex). That failure counts against the call's round budget with the undelayed sends to#_internal, so a chart that sends again on every failure halts.The conformance runner (
Conformance::Host#reportandConformance::Callsin the test tree) reports a send whose expected item carries"outcome": "fail"once the driver call that handed it returns, before the configuration is read, as the reference's harness does inpump/3oflib/mix/statifier/corpus/host_case.ex; a report refused because the chart has stopped or halted is dropped. The ratchet recordsstatifier/send/registered_send_failed, so the statifier claim follows its entries.Tests
FailuresTest(driver): the event's fields for an author-named and a generated send id; the drain after the report; the stopped and halted refusals; the argument checks; aDeliveryFailureraising the event within the call; the round budget bounding a chart that resends on every failure.HostTest(runner): a send marked failed is reported before the configuration is read, an unmarked one is not, and a report to a stopped chart is dropped.StatifierSuiteTest: the failed-send case is no longer among the cases left.Every new test that asserts behaviour carries its sabotage note; each mutation was applied, turned its test red on an assertion, and was restored byte-equal.
Gate
The full gate (
mise exec -- bundle exec rake) ran green on the committed tree: rubocop clean, the corpus check, the registry check (every entry passes), and the test suite with 0 failures under the coverage minimum. The commit was made with no change between that run and the commit.Provenance
The method's name follows statifier-ts's
reportSendFailedin snake case (decided by the conductor under a standing consent, 2026-10-23). These engineering choices were taken in the bead and are open to the review:Statifier.stepandStatifier.advancetake only the state; the chart is checked against the state's own machine (equal by value, so a fresh compile of the same source is accepted). Dropping the parameter before 0.1.0 is a one-line change.**optionsand checked against a defaults table, asStatifier.starttakes its options; the unknown-option check is shared withstart's through one helper inStatifier::Driver::Checks.:haltedis a new refusal for a report to a budget-halted chart, where the reference drops it silently: a refusal tells the host the miss is its own to record.Statifier::Driver::DeliveryFailure, following statifier-ts'sDeliveryFailure; an exception raised bydeliverstill propagates unchanged.Statifier::Driver::Routinginto a new internal module,Statifier::Driver::Delivery, beside the failed-send write;Routing.communication_errortakes thesendidas a keyword so both paths build the event in one place.failed_send/3delivers the event and runs the chart to quiescence within the call.A send an invoked child handed is reported against the session the state is for; routing a report to a child session is not part of this change.