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

Avoid lock up on unexpected ExecutorService errors while executing Local Activities #2371

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

Sushisource
Copy link
Member

@Sushisource Sushisource commented Jan 16, 2025

What was changed

Avoid putting the worker into a useless state if submitting a local activity for execution fails (ex: OOM / other thread starting problems).

Why?

Bad times when you don't know why your worker is stuck

Checklist

  1. Closes Failure to allocate thread can lock up local activities #2349

  2. How was this tested:
    Added an integration test with an executor service that fails intentionally

  3. Any docs updates needed?

@Sushisource Sushisource requested a review from a team as a code owner January 16, 2025 00:24
10,
TimeUnit.SECONDS,
synchronousQueue ? new SynchronousQueue<>() : new LinkedBlockingQueue<>());
new ThreadPoolExecutor(0, threadPoolMax, 10, TimeUnit.SECONDS, new SynchronousQueue<>());
Copy link
Contributor

Choose a reason for hiding this comment

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

So I am fine with this change, but it will mean that any submission to the threadPoolTaskExecutor will not be blocking if the threadPoolMax is full. Did you confirm the submitter can handle this and we have appropriate test coverage?

Copy link
Member Author

Choose a reason for hiding this comment

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

Made sure this works via a small change to testParallelLocalActivities

@Sushisource Sushisource merged commit 3ad0b0e into temporalio:master Jan 17, 2025
8 checks passed
@Sushisource Sushisource deleted the la-executor-errors branch January 17, 2025 22:59
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.

Failure to allocate thread can lock up local activities
2 participants