patch for interrupt in subgrahph #2936
Open
+1
−1
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.
Issue Description
While working with interrupts in subgraphs, I noticed that the interrupt mechanism fails to function correctly when invoked for the second time. Specifically, the interrupt does not halt execution as expected during subsequent invocations, leading to unintended continuation of node execution.
Solution
To address this issue, I modified the logic to ensure that the
writes
variable is only updated if__interrupt__
is explicitly present inconf[__pregel_writes]
. If__interrupt__
is not found,writes
remains an empty list. This change ensures that the graph halts execution as expected when an interrupt is encountered and prevents thewrites
variable from being populated with invalid or unintended values.Changes Made
writes
(see code link) to check for the presence of__interrupt__
in__pregel_writes
.__interrupt__
is found,writes
is updated with the corresponding value.__interrupt__
is not found,writes
remains an empty list.Impact
This change ensures that: