-
Notifications
You must be signed in to change notification settings - Fork 152
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
Avoid lock up on unexpected ExecutorService errors while executing Local Activities #2371
Conversation
a1a5e73
to
c1a2a0d
Compare
c1a2a0d
to
2a8c377
Compare
10, | ||
TimeUnit.SECONDS, | ||
synchronousQueue ? new SynchronousQueue<>() : new LinkedBlockingQueue<>()); | ||
new ThreadPoolExecutor(0, threadPoolMax, 10, TimeUnit.SECONDS, new SynchronousQueue<>()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
temporal-sdk/src/main/java/io/temporal/internal/worker/LocalActivitySlotSupplierQueue.java
Outdated
Show resolved
Hide resolved
aba6d89
to
1c4ef46
Compare
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
Closes Failure to allocate thread can lock up local activities #2349
How was this tested:
Added an integration test with an executor service that fails intentionally
Any docs updates needed?