Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the BlockedThreadChecker of Vert.x?

Tags:

vert.x

The BlockedThreadChecker causes a lot of stdout when debugging vert.x code. This question relates to vert.x 3.

like image 298
Jotschi Avatar asked Feb 12 '15 09:02

Jotschi


4 Answers

VertxOptions options = new VertxOptions();
options.setBlockedThreadCheckInterval(1000*60*60);

https://groups.google.com/forum/#!searchin/vertx/BlockedThreadChecker/vertx/MWx8ma7Ig4o/rFqdYdDErtYJ

NOTE: Disable only for debugging. Otherwise issues which can affect the performance of Vert.x can't be located easily.

like image 79
Jotschi Avatar answered Nov 14 '22 12:11

Jotschi


Alternatively you can add the following system property to the vertx startup script, will set the event loop execute time to 10 seconds (note the input is in NS):

-Dvertx.options.maxEventLoopExecuteTime=10000000000

like image 13
adamM Avatar answered Nov 14 '22 13:11

adamM


For anybody interested on this, in case you don't want to change vertx options, you can set the log level to ERROR or OFF for BlockedThreadChecker.

Configuration in logback.xml will look something like this:

<configuration>
    ...
        <logger name="io.vertx.core.impl.BlockedThreadChecker" level="OFF" />
    ...
</configuration>
like image 9
ramtech Avatar answered Nov 14 '22 13:11

ramtech


Our thread blocking issues are during deployment so we simply turn off logging dynamically during deployment and turn it back on once that's complete log4j2 this looks like:

        org.apache.logging.log4j.core.Logger threadStuckLogger = (org.apache.logging.log4j.core.Logger)LogManager.getLogger(BlockedThreadChecker.class);
        Level threadStuckLevel = threadStuckLogger.getLevel();
        threadStuckLogger.setLevel(Level.ERROR);

// deploy....

        threadStuckLogger.setLevel(threadStuckLevel);
like image 1
MSillence Avatar answered Nov 14 '22 13:11

MSillence