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

PAYARA-4118 Speedup Payara shutdown by having GFFileHandler use its o… #4250

Merged
merged 2 commits into from
Oct 7, 2019

Conversation

Cousjava
Copy link
Contributor

@Cousjava Cousjava commented Oct 4, 2019

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

  • Quicklook
  • Payara Samples
  • Java EE7 Samples
  • Java EE8 Samples
  • Payara Private Tests
  • Payara Microprofile TCKs Runner
  • Jakarta TCKs
  • Mojarra
  • Cargo Tracker

Testing Environment

"Zulu JDK 1.8_222 on Ubuntu 19.04 DIsco Dingo with Maven 3.6.0"-->

@Cousjava Cousjava added this to the 5.194 milestone Oct 4, 2019
@Cousjava Cousjava requested a review from pdudits October 4, 2019 13:34
@Cousjava
Copy link
Contributor Author

Cousjava commented Oct 4, 2019

Jenkins test please

…wn thread

GFFileHandler no longer uses PayaraExecutorService
This is a partial revert of f60de6a / payara#3437
@Cousjava Cousjava force-pushed the PAYARA-4118-speedup-shutdown branch from 4ddcf7f to 5dc63c6 Compare October 4, 2019 13:58
@Cousjava
Copy link
Contributor Author

Cousjava commented Oct 4, 2019

Jenkins test please

Copy link
Contributor

@MarkWareham MarkWareham left a 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

@Pandrex247 Pandrex247 changed the title PAYARA-4118 Sppedup Payara shutdown by having GFFileHandler use its o… PAYARA-4118 Speedup Payara shutdown by having GFFileHandler use its o… Oct 7, 2019
Comment on lines -606 to -607
drainAllPendingRecords();
flush();
Copy link
Contributor

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) {
Copy link
Contributor

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

Copy link
Member

@Pandrex247 Pandrex247 left a 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() {
Copy link
Member

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?"

@Cousjava
Copy link
Contributor Author

Cousjava commented Oct 7, 2019

Jenkins test please

@Cousjava Cousjava merged commit ef7f590 into payara:master Oct 7, 2019
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.

4 participants