Skip to content

Breaking: set code on every perform.hot_cell event and rename Verdict to Failure::Exception - #109

Merged
flavorjones merged 4 commits into
masterfrom
card-657-yabeda-exception-counted-ok-redesign
Oct 10, 2026
Merged

flavorjones merged 4 commits into
masterfrom
card-657-yabeda-exception-counted-ok-redesign

Conversation

@flavorjones

@flavorjones flavorjones commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Motivation

The code used several words for the same few ideas. Whether a call failed was ok on the wire, code: nil on the perform.hot_cell event, and "ok" in the log line and the metric. The failure itself was a Failure in Ruby, error on the wire, a Verdict on the exception, and a "verdict" or an "outcome" in comments and docs.

Subscribers also had to work out a call's result from the event. publish runs only when the transport returns, so an exception that escapes the call, such as the application's own request timeout, leaves no code on the event. HotCell::LogSubscriber handled that case. yabeda-hotcell did not: it counted the call as code="ok" with a perform of 0 seconds (#93).

Fixes #93

Details

The code now uses four words: a failure has a code, an optional cause, and is permanent or not.

  • The client sets code on every perform.hot_cell event: ok on success, the failure's code on failure, and interrupted when an exception interrupts the call. HotCell::LogSubscriber and yabeda-hotcell record code as the event gives it. yabeda-hotcell records no perform observation for an interrupted call. This includes the test from Fix yabeda-hotcell counting a call interrupted by an exception as ok #108, with interrupted in place of exception.
  • HotCell::Verdict is renamed HotCell::Failure::Exception, and HotCell::Client::Legacy::Verdict is renamed HotCell::Client::Legacy::Failure::Exception.
  • Comments, docs and test names say "failure", "code", "cause" and "permanent", and "answer" for what a cell sends back. Supervisor#outcome_code is renamed reported_code.
  • The wire format is unchanged. Renaming its error key would need a protocol version bump and would change no behavior.

The event's code and the Failure::Exception rename are breaking changes. The CHANGELOG's Upgrading section lists what an application changes.

Additional information

This replaces #108, which fixed #93 by adding an exception label to yabeda-hotcell alone.

The server log's event.outcome field keeps its name, because ECS defines it. "outcome" also stays in comments where it means the result of a filesystem operation.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@flavorjones
flavorjones force-pushed the card-657-yabeda-exception-counted-ok-redesign branch from 6c1646a to f85f49e Compare October 9, 2026 20:35
@flavorjones flavorjones changed the title Breaking: set code on every perform.hot_cell event and rename Verdict to FailedCall Breaking: set code on every perform.hot_cell event and rename Verdict to FailureError Oct 9, 2026
@flavorjones flavorjones changed the title Breaking: set code on every perform.hot_cell event and rename Verdict to FailureError Breaking: set code on every perform.hot_cell event and rename Verdict to Failure::Exception Oct 9, 2026
@flavorjones
flavorjones force-pushed the card-657-yabeda-exception-counted-ok-redesign branch from f85f49e to b44aa1c Compare October 9, 2026 20:52
@flavorjones
flavorjones force-pushed the card-657-yabeda-exception-counted-ok-redesign branch from b44aa1c to 0c08009 Compare October 10, 2026 17:15
The event left `code` nil on success and unset when an exception
escaped the call, so `HotCell::LogSubscriber` and `yabeda-hotcell` each
derived the call's result, and `yabeda-hotcell` counted an interrupted
call as `ok` with a `perform` of 0 seconds. Set `code` to `ok` on
success and to `interrupted` when an exception interrupts the call, and
have both subscribers record it as given.

[Fix #93]
`Verdict` was a third name for a failure, beside `Failure` and the
wire's `error`. Rename `HotCell::Verdict` to
`HotCell::Failure::Exception`, and `HotCell::Client::Legacy::Verdict`
to `HotCell::Client::Legacy::Failure::Exception`. `hot_cell_failure` is
unchanged.

Inside `HotCell::Failure`, a bare `Exception` now names the new module,
so `Failure.for` checks for `::Exception`.
Comments, docs and test names called a failure a "verdict", and the
`requests` metric counted calls "by outcome". Use "failure", "code",
"cause" and "permanent", and "answer" for what a cell sends back.
Rename `Supervisor#outcome_code` to `reported_code` and `verdict_for`
in `examples/load` to `code_for`.

The log's `event.outcome` keeps its name because ECS defines it, and
"outcome" stays where it means the result of a filesystem operation.
@flavorjones
flavorjones force-pushed the card-657-yabeda-exception-counted-ok-redesign branch from 0c08009 to 26f8c7b Compare October 10, 2026 17:22
@flavorjones
flavorjones merged commit 430ca79 into master Oct 10, 2026
33 checks passed
@flavorjones
flavorjones deleted the card-657-yabeda-exception-counted-ok-redesign branch October 10, 2026 17:31
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.

yabeda-hotcell counts a call interrupted by an exception as code="ok"

2 participants