Skip to content

feat(resumption): check pause state and worker claim on each batch iteration - #926

Merged
andrzejfudro merged 1 commit into
feat/task-queue-add-message-errorfrom
feat/ess-resumption-fencing-and-metadata
Sep 22, 2026
Merged

andrzejfudro merged 1 commit into
feat/task-queue-add-message-errorfrom
feat/ess-resumption-fencing-and-metadata

Conversation

@andrzejfudro

@andrzejfudro andrzejfudro commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds shouldStopReplay in ResumptionWorker.runBatchLoop to check on every batch iteration whether scheduling has been re-paused, whether ResumptionRunID has changed, or whether another worker has claimed ResumptionWorkerID, halting the loop gracefully if so.
  • Adds table-driven unit tests (TestResumptionWorker_MidLoopTermination) covering mid-resumption re-pause, run ID change, and worker ID preemption across batches.

Stacked on #937.

TAG=agy
CONV=7f1eb701-864f-489a-ad0e-57b1c6f25a2e

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces resumption metadata (run ID and resumption time) to task queue payloads and adds mid-loop safety checks (re-pause, run ID changes, and worker fencing) to the resumption worker. It also updates the Redis publisher interface to return errors and propagates them. The review feedback highlights three potential nil pointer dereferences that could lead to runtime panics: when accessing the pause state in the resumption worker, when handling a nil action in the task queue client, and when applying resumption metadata options to a nil metadata pointer.

Comment thread internal/task_queue/client.go Resolved
Comment thread internal/task_queue/client.go Resolved
@andrzejfudro
andrzejfudro added this pull request to stack #928 September 21, 2026 06:55
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch 2 times, most recently from 14f0ce3 to 9f24988 Compare September 21, 2026 12:30
@andrzejfudro andrzejfudro changed the title feat(resumption): add mid-loop fencing, resumption metadata, and error propagation feat(resumption): check pause state and worker claim on each batch iteration Sep 21, 2026
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from 9f24988 to 98e2371 Compare September 21, 2026 12:34
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from 98e2371 to d6ead79 Compare September 21, 2026 12:41
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch 2 times, most recently from 80610e4 to de95c23 Compare September 21, 2026 12:57
@andrzejfudro
andrzejfudro removed this pull request from stack #928 September 21, 2026 12:58
@andrzejfudro
andrzejfudro changed the base branch from feat/ess-resumption-worker-loop to feat/task-queue-add-message-error September 21, 2026 12:58
@andrzejfudro
andrzejfudro added this pull request to stack #938 September 21, 2026 12:58
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from de95c23 to f07e931 Compare September 21, 2026 13:10
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from f07e931 to b945a48 Compare September 21, 2026 13:27
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from b945a48 to a3e2f93 Compare September 21, 2026 13:32
@andrzejfudro
andrzejfudro force-pushed the feat/ess-resumption-fencing-and-metadata branch from a3e2f93 to 7293f75 Compare September 21, 2026 14:27
@andrzejfudro
andrzejfudro marked this pull request as ready for review September 21, 2026 14:31
@andrzejfudro
andrzejfudro added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 45ffcec Sep 22, 2026
12 checks passed
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.

2 participants