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

Support customizing BlockedThreadChecker #4283

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

dano
Copy link
Contributor

@dano dano commented Feb 21, 2022

Signed-off-by: Dan O'Reilly oreilldf@gmail.com

Adds support for customizing the implementation of BlockedThreadChecker, exposing an API that allows users to pass a callback that will be executed whenever a thread is blocked for longer than the allowed duration. To use the API, users have to call the blockedThreadChecker() getter on VertxInternal.

Motivation:
In my application, I want to be able to restart the JVM if thread stay blocked for an extended period of time, so that my application can potentially self-heal if something goes very wrong and a thread ends up stuck forever. It's currently not possible to do this (at least as far as I can tell). Adding this new API makes it possible.

@dano dano force-pushed the blocked-thread-checker-factory branch 4 times, most recently from bf4fe5a to 5faf826 Compare February 22, 2022 18:40
@vietj
Copy link
Member

vietj commented Feb 23, 2022

the BlockedThreadChecker class should be moved to a impl.btc package and the nested class event should become a regular class instead.

@vietj
Copy link
Member

vietj commented Feb 23, 2022 via email

@dano dano force-pushed the blocked-thread-checker-factory branch 2 times, most recently from 476e838 to 4c8ffe3 Compare February 23, 2022 14:33
@dano dano requested a review from vietj February 23, 2022 15:00
Copy link
Member

@vietj vietj left a comment

Choose a reason for hiding this comment

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

minor change on BlockedThreadEvent and we are good to go

Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
@dano dano force-pushed the blocked-thread-checker-factory branch from 4c8ffe3 to 13e9571 Compare February 24, 2022 14:30
@dano dano requested a review from vietj February 24, 2022 15:06
@vietj vietj added this to the 4.3.0 milestone Feb 25, 2022
@vietj vietj merged commit daf5bbc into eclipse-vertx:master Mar 2, 2022
@vietj
Copy link
Member

vietj commented Mar 2, 2022

thanks for the contribution @dano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants