-
Notifications
You must be signed in to change notification settings - Fork 306
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
PAYARA-3267 Fixing memory-wastage with JavaEETransactionImpl #3398
PAYARA-3267 Fixing memory-wastage with JavaEETransactionImpl #3398
Conversation
…vice which is configured to remove cancelled tasks immediately
Jenkins test please |
TimeUnit.valueOf(payaraExecutorServiceConfiguration.getThreadPoolExecutorKeepAliveTimeUnit()), | ||
new SynchronousQueue<>(), (Runnable r) -> new Thread(r, "payara-executor-service-task")); | ||
} | ||
|
||
scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor( | ||
Integer.valueOf(payaraExecutorServiceConfiguration.getScheduledThreadPoolExecutorCorePoolSize()), | ||
(Runnable r) -> new Thread(r, "payara-executor-service-scheduled-task")); | ||
scheduledThreadPoolExecutor.setRemoveOnCancelPolicy(true); |
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 think this should be configurable on the service
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.
Also I think the old purge on x number of tasks should be also retained in case there is a performance hit on removing the tasks for many small and rapid transactions like in high volume web applications with timeouts enabled.
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.
Removed config from PayaraExecutorService
@@ -109,11 +112,13 @@ | |||
@Inject protected InvocationManager invMgr; | |||
|
|||
@Inject private Provider<RequestTracingService> requestTracing; | |||
|
|||
|
|||
@Inject private PayaraExecutorService payaraExecutorService; |
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 don't think Payara Executor Service should be used for this. This is core application processing logic and I feel this could overload the Payara Executor Service which was planned for more internal tasks. For example if you have a web application performing 100s of requests per second with timeouts enabled we could be adding and removing 100s of timeout tasks per second on this Executor Pool. I approve of replacing timer with the more modern executor service though.
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.
Replaced PayaraExecutorService with newly created ScheduledThreadPoolExecuter
…edThreadPoolExecutorService. Using this service also for local monitoring timer.
…enting usage of configuration of tx service property purge-cancelled-transactions-after. using scheduled task to purge.
@smillidge Implemented your requested changes. Maybe the |
@smillidge Nice to see you going all-in on the PayaraExecutorService. Using it everywhere now. ;) |
Jenkins test please |
… Setting purge property in production domain.xml to 500.
jenkins test |
…-waste-using-timer # Conflicts: # appserver/admin/production_domain_template/src/main/resources/config/domain.xml
Resolved merge conflicts |
Jenkins test please |
Fixes #3396 |
Replacing usage of java.util.Timer/TimerTask with PayaraExecutorService/ScheduledExecutorService which is configured to remove cancelled tasks immediately.
This should fix #3396