Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ExecutorWrapper in WorkerFactoryOptions #988

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

shijiesheng
Copy link
Member

@shijiesheng shijiesheng commented Mar 26, 2025

What changed?

  • added new option in WorkerFactoryOptions to expose user provided ExecutorWrapper
  • added a ExecutorWrapper interface
  • apply ExecutorWrapper to executors in heartbeat, pollers (both poller executor and poller task executor), SyncActivityWorker and SyncWorkflowWorker.

Why?

By wrapping the ExecutorWrapper, it is now possible to propagate "root" context in background polling and task executions. Uber internally built a threadlocal storage to propagate context inside executors.

How did you test it?

Unit Test
WIP internal test samples on context propagation

Potential risks

No risk due to it's a new fiel with fallback on original behavior

Release notes

Documentation Changes

@shijiesheng shijiesheng changed the title added ThreadFactoryWrapper in WorkerFactoryOptions added ExecutorWrapper in WorkerFactoryOptions Apr 2, 2025
Copy link
Member

@natemort natemort left a comment

Choose a reason for hiding this comment

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

It would be nice to have tests for this but I can't think of any reasonable way to go about that.

@shijiesheng shijiesheng merged commit 6abced9 into cadence-workflow:master Apr 2, 2025
7 checks passed
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