-
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-4118 Speedup Payara shutdown by having GFFileHandler use its o… #4250
Conversation
Jenkins test please |
…wn thread GFFileHandler no longer uses PayaraExecutorService This is a partial revert of f60de6a / payara#3437
4ddcf7f
to
5dc63c6
Compare
Jenkins test please |
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.
Quick glance through. Should be good as a revert
drainAllPendingRecords(); | ||
flush(); |
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 about this code branch? Shouldn't it remain in the block?
By the way using new Thread(Runnable)
would allow you to retain original lambda.
|
||
public static LogRotationTimer getInstance() { | ||
return instance; | ||
} | ||
|
||
public void startTimer(ScheduledExecutorService scheduledExecutorService, LogRotationTimerTask timerTask) { |
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.
On the other hand, this was task very fit for payara executor service, as it is very infrequent timed one
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.
Don't really have a reproducer so can't test before vs. after, but just a minor comment.
pumpFuture = payaraExecutorService.submit( | ||
() -> { | ||
while (!done.isSignalled() && logToFile) { | ||
pump = new Thread() { |
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.
It might be worth putting in a comment explaining why we're not using a the managed executor service here so that we don't come back to this in a year's time and go "why is that not using a managed executor?"
Jenkins test please |
Description
This is a performance imporvement
reverts #3437
Due to the behaviour of GFFileHandler logpump it is better for it to be in it's own thread rather than use the executor service, having it as part of the executor service causes it to carry on running until killed.
Testing
New tests
None
Testing Performed
Ran the command
asadmin start-domain --verbose --debug && date +"%Y-%m-%d %H:%M:%S.%3N
to print out time with milliseconds after domain is stopped, and compared that time with time that server shutdown was started.Time before PR - 6.398 seconds
Time with 4ddcf7f - 1.235 seconds
Test suites executed
Testing Environment
"Zulu JDK 1.8_222 on Ubuntu 19.04 DIsco Dingo with Maven 3.6.0"-->