-
Notifications
You must be signed in to change notification settings - Fork 593
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
Executor service fixes #3307
Executor service fixes #3307
Conversation
10, | ||
10, | ||
1000, |
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.
what do these magic numbers refer to?
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.
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.
Ok, so the 1000
for keepAliveTime
will have no effect here since we're setting core and max to 10.
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.
I am concerned the original QueueExecutorService has a single thread by design, to ensure the jobs are serialized. Hard to say without comment. If it was by design, this PR is changing the design.
@@ -82,15 +82,19 @@ protected void afterExecute(Runnable t, Throwable e) { | |||
private final ThreadObserverHelper _observerHelper; | |||
} | |||
|
|||
// The thead pool executor uses an unbounded queue. The tasks would wait in the queue until a | |||
// core pool thread is available to run it and the value of the maximumPoolSize therefore | |||
// doesn't have any effect. |
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.
The comment is not clear.
Presumably, maximumPoolSize has not effect because the executor uses an unbounded queue? As written, it sounds like a consequence of the wait?
It's also not clear to me what this means / add:
The tasks would wait in the queue until a core pool thread is available to run it
This is not obvious?
If you look at when we use this executor there are two situations:
ice/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java Lines 920 to 936 in e99d2e5
The interrupt case is about about ensuring that Java interrupt works correctly. See https://doc.zeroc.com/ice/latest/property-reference/miscellaneous-ice-properties#id-.MiscellaneousIce.*Propertiesv3.7-Ice.ThreadInterruptSafe We have Ice/interrupt test in Java with seems to work fine with this PR. In the android case this is about not calling IO APIs from the main thread, and unrelated to serialization. I guess it would be safer to just change the behavior for Android, as this doesn't seems necessary for the other use case. |
Fix #3300