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

Implement metrics for thread pool suppliers (3.0) #3652

Merged
merged 8 commits into from
Jan 19, 2022
Merged

Implement metrics for thread pool suppliers (3.0) #3652

merged 8 commits into from
Jan 19, 2022

Conversation

tjquinno
Copy link
Member

Resolves #3639

For description see PR #3630 (2.x)

@tjquinno tjquinno added this to the 3.0.0 milestone Nov 17, 2021
@tjquinno tjquinno self-assigned this Nov 17, 2021
@tjquinno tjquinno changed the title Implement metrics for thread pool suppliers Implement metrics for thread pool suppliers (3.0) Nov 17, 2021
@@ -202,7 +200,8 @@ private void sendResponse(ServerResponse res, Response response) {
}
}

void terminate(@Observes @BeforeDestroyed(ApplicationScoped.class) Object event) {
@PreDestroy
void terminate() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had suspicion it gets invoked twice in some hard to replicate cases and agreed to take this pre-emptive action

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local tests, I was seeing the class instantiated twice. From the stack traces in the debugger is seemed that CDI was instantiating it the second time in order to notify it of the before-destroyed event. Because the logic in the method was simply cleaning up resources allocated by the bean itself (and not really taking action related to the shut-down of other beans), using @PreDestroy not only resolved the problem I was seeing but also more closely aligned with the work the method was doing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomas-langer Are you OK with this? Was this your only concern? I would like to merge this PR.

@tjquinno tjquinno merged commit ed0e8c8 into helidon-io:master Jan 19, 2022
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.

Metrics for thread pools (3.x)
3 participants