Skip to content

Commit 50e3516

Browse files
committed
Drop remaining pause wording and fix the none-mode suspend check
The glutton none-mode test looked for an async suspend under a name the fake never records, so it could not catch one; check "SuspendActor(async)", the name suspendCallName records. RevertActor docs in the proto and kubectl-ate still listed paused actors. The state they meant is a suspended actor whose snapshot has not reached storage yet, so say that instead.
1 parent da44a34 commit 50e3516

6 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎cmd/kubectl-ate/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ kubectl ate suspend actor my-actor -a <atespace>
208208
# Suspend an actor and wait for its snapshot to reach storage.
209209
kubectl ate suspend actor my-actor -a <atespace> --mode=sync
210210

211-
# Revert an actor to its last external snapshot (discards live, paused, or crashed state and returns to SUSPENDED)
211+
# Revert an actor to its last external snapshot (discards live, crashed, or not-yet-uploaded suspended state and returns to SUSPENDED)
212212
kubectl ate revert actor my-actor -a <atespace>
213213

214214
# Delete an actor (by default, requires the actor to be SUSPENDED or CRASHED).

‎cmd/kubectl-ate/internal/cmd/revert_actor.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ var revertActorCmd = &cobra.Command{
3131
Long: `Revert an actor to SUSPENDED, discarding its current execution.
3232
3333
The actor's external snapshot is left untouched, so a later resume restores
34-
from it. Only crashed, running, or paused actors can be reverted.`,
34+
from it. Only crashed or running actors, or suspended actors whose snapshot
35+
has not reached storage yet, can be reverted.`,
3536
Args: exactlyOneArg("<actor-name>", "atespace"),
3637
RunE: func(cmd *cobra.Command, args []string) error {
3738
ctx := cmd.Context()

‎internal/benchmarking/boomer/glutton/lifecycle_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ func TestGluttonIterate_NoneMode(t *testing.T) {
9595
rt.iterate()
9696

9797
calls := fakeCtrl.recordedCalls()
98-
if slices.Contains(calls, "SuspendActor") || slices.Contains(calls, "SuspendActorAsync") {
99-
t.Errorf("did not expect SuspendActor or SuspendActorAsync during iterate in none mode, got: %v", calls)
98+
if slices.Contains(calls, "SuspendActor") || slices.Contains(calls, "SuspendActor(async)") {
99+
t.Errorf("did not expect a sync or async SuspendActor during iterate in none mode, got: %v", calls)
100100
}
101101
if got := countCalls(calls, "ResumeActor"); got != 1 {
102102
t.Errorf("ResumeActor count across 2 iterations = %d, want 1 (first activation only); calls = %v", got, calls)

‎internal/benchmarking/boomer/resumepaused/resumepaused.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ func (r *runtime) cycle(name string) {
259259
// recover suspends an actor asynchronously after a failed cycle, so it is cold
260260
// for the next one. It is load on the server like any other call, so it is
261261
// recorded, as SuspendActorAsyncRecovery to keep it apart from the measured
262-
// suspends. An actor
263-
// already paused fails it with FailedPrecondition; the actor is cold, which
264-
// is all recovery wants, so that counts as a success.
262+
// suspends. An actor already suspended fails it with FailedPrecondition; the
263+
// actor is cold, which is all recovery wants, so that counts as a success.
265264
func (r *runtime) recover(ctx context.Context, name string) {
266265
_ = r.call(ctx, "SuspendActorAsyncRecovery", func(ctx context.Context) error {
267266
_, err := r.cfg.APIStub.SuspendActor(ctx, &ateapipb.SuspendActorRequest{

‎pkg/proto/ateapipb/ateapi.proto‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ service Control {
5050
}
5151

5252
// Revert an actor to SUSPENDED state at its durable snapshot.
53-
// Only crashed, running or paused actors can be reverted.
53+
// Only crashed or running actors, or suspended actors whose snapshot has
54+
// not reached storage yet, can be reverted.
5455
rpc RevertActor(RevertActorRequest) returns (RevertActorResponse) {
5556
option (method).resource = "Actor";
5657
}

‎pkg/proto/ateapipb/ateapi_grpc.pb.go‎

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)