Skip to content

[Bug]: Plugin hooks can return operations with negative duration #557

Description

@nvasiu

Expected Behavior

OperationStartInfo.start_time should always be before OperationEndInfo.end_time.

Actual Behavior

OperationStartInfo.start_time uses datetime.now(), while OperationEndInfo.end_time uses recorded operation timestamps.

It is possible for operations to record an end_time that precedes the now() call, resulting in a negative duration. Plugins consuming these callbacks will get invalid timings.

Steps to Reproduce

  1. Register a plugin that records the start time from on_operation_start and on_operation_end.
  2. Run a durable handler with a fast context step (returns immediately).
  3. Compare the start/end times in OperationStartInfo and OperationEndInfo

SDK Version

1.7.0

Python Version

3.14

Is this a regression?

No

Last Working Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

SDKrelated to the AWS Durable Execution SDK

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions