Skip to content

feat(sdk): Add DurableInstrumentationPlugin interface and plugin runner#408

Open
ayushiahjolia wants to merge 1 commit into
mainfrom
plugin-interface
Open

feat(sdk): Add DurableInstrumentationPlugin interface and plugin runner#408
ayushiahjolia wants to merge 1 commit into
mainfrom
plugin-interface

Conversation

@ayushiahjolia
Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#364

Description

Introduce the plugin system foundation for the durable execution SDK:

  • DurableInstrumentationPlugin interface with lifecycle hooks for execution, invocation, operation, and attempt-level events
  • PluginRunner that composes multiple plugins with fire-and-forget and callback-wrapping execution semantics
  • Info records (InvocationInfo, OperationInfo, AttemptInfo, AttemptEndInfo, OperationEndInfo, ExecutionEndInfo, OperationChangeInfo)
  • withPlugins(List) config field in DurableConfig.Builder

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes? N/A

Integration Tests

Have integration tests been written for these changes? N/A

Examples

Has a new example been added for the change? (if applicable) N/A

@ayushiahjolia ayushiahjolia marked this pull request as ready for review May 27, 2026 23:03
@ayushiahjolia ayushiahjolia requested a review from a team May 27, 2026 23:03
* @param outcome the attempt outcome (SUCCEEDED, FAILED, or RETRYING)
* @param error non-null if the attempt failed
* @param nextAttemptDelaySeconds non-null if outcome is RETRYING
* @experimental This record is experimental and may be changed or removed in future releases.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this tag actually exists in Javadoc, I think people use @deprecated instead with an explanation that it's experimental.

chain = () -> {
try {
return hookExtractor.apply(plugin).apply(next);
} catch (Exception e) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the JS runAsCallback as follows: https://github.com/aws/aws-durable-execution-sdk-js/blob/bcea797ed2ba70949b1b755f6b92064705ad2cb3/packages/aws-durable-execution-sdk-js/src/utils/plugin/plugin-runner.ts#L21

it will not swallow the errors in the customer provided function but it swallows the plugin exceptions.

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