Skip to content

Commit 9a46294

Browse files
fix(plugin): omit plugin input when copy fails
Return None rather than the shared reference when the execution input cannot be deep-copied, so handler isolation holds even when a snapshot cannot be created. Applied from an AI review suggestion. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8267552 commit 9a46294

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python

packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,11 @@ def _snapshot_execution_input(self, execution_input: Any) -> Any:
406406
try:
407407
return copy.deepcopy(execution_input)
408408
except Exception:
409-
# A plugin-facing view must never break the execution. Fall back to
410-
# the shared reference rather than dropping the input entirely.
409+
# Preserve handler isolation if a snapshot cannot be created.
411410
logger.exception(
412-
"Failed to copy execution input for plugins; passing shared reference"
411+
"Failed to copy execution input for plugins; omitting plugin input"
413412
)
414-
return execution_input
413+
return None
415414

416415
def on_invocation_end(
417416
self,

0 commit comments

Comments
 (0)