Skip to content

durable: keep or remove the settledJSON holder between a settle and its journal Record #271

Open

Description

@reka18

For Temple's ruling. Split out of #255, item 1.

What it is. When a service or an actor settles, durable's result transform decodes the outcome. It then leaves the encoded JSON and the Go type in a shared holder (settledJSON), and the code that writes the journal Record reads them back with take(). If a path ever forgets that call, the next step journals the previous settle's bytes. No path forgets it today. Since #268, the service side has two take() calls, one right after the settle in serviceStep and a defensive clear in Recover. The actor side takes its outcome inside the transform.

Option A: leave it. There's no code change. The hazard stays contained inside durable, and the two call sites are documented.

Option B: return the outcome through the transform. ServiceRunner.WithResultTransform and ActorSystem.WithSettleTransform would each return the encoded JSON and the type name as one more value, and durable would read that value directly. That removes the holder and the take() calls.

My suggestion: Option A, since it keeps durable's concern out of state's API. It's your call.

Relates to: #255, #258, #268

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions