Add InterruptedWatchdog scaffolding#148
Merged
Merged
Conversation
The watchdog polls GetInterruptedFunctions and calls FlowsManager.Interrupt with ids owned by this replica (i.e. present in FlowsManager's in-memory dict). FlowState.Interrupt and FlowsManager.Interrupt are stubbed for now: the existing implementations raced with SuspendFunction's Interrupted-flag check (clearing the flag mid-flight caused suspended-vs-postponed-status to be decided wrong, leaving flows stuck). Adds FilterOwned helper.
- Replace two redundant/misnamed GetInterruptedFunctions tests with distinct scenarios: idempotent multi-interrupt returns single id, and interrupting a Postponed function still surfaces it. - Remove the obsolete argument from new FlowsManager(...) call sites in test files now that FlowsManager has no constructor parameter.
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.
Summary
InterruptedWatchdogthat pollsGetInterruptedFunctionsand callsFlowsManager.Interruptwith the subset owned by this replica (present inFlowsManager's in-memory dict).FlowsManager.FilterOwned(ids)so the watchdog can scope to locally-running flows under the existing lock.FunctionsRegistryctor, started underEnableWatchdogs. Shutdown via existingShutdownCoordinator.Note on stubs
FlowState.InterruptandFlowsManager.Interrupt'sResetInterruptedcall are stubbed for now. The earlier implementations raced withSuspendFunction: when the watchdog cleared the persistentInterruptedflag mid-flight (afterAppendMessageset it, beforeSuspendFunctionread it), the flow transitioned toSuspendedinstead ofPostponedand never restarted. Scaffolding is in place; semantics can be re-introduced once the suspend-design direction lands.Test plan