gpt4 book ai didi

vert.x - Vertx 线程阻塞警告

转载 作者:行者123 更新时间:2023-12-02 00:39:21 25 4
gpt4 key购买 nike

我在 ubuntu 服务器上运行一个 vert.x 应用程序。它有一个在端口 3000 上运行的 HTTPServer。应用程序工作正常,但有时我会看到以下警告:

Dec 08, 2017 1:23:43 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 138013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:44 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 139014 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:45 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 140013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:46 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 141013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:47 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 142013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:48 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 143013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:49 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 144013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Dec 08, 2017 1:23:50 AM io.vertx.core.impl.BlockedThreadChecker
WARNING: Thread Thread[vert.x-worker-thread-2,5,main] has been blocked for 145013 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:441)
at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:331)
at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:226)
at java.security.SecureRandom.generateSeed(SecureRandom.java:533)
at io.vertx.ext.auth.PRNG.lambda$null$0(PRNG.java:78)
at io.vertx.ext.auth.PRNG$$Lambda$204/767088095.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271)
at io.vertx.core.impl.ContextImpl$$Lambda$206/1202956360.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

我无法理解是什么导致出现这些警告。在发出警告时,服务器处于空闲状态,应用程序的流量为 0。此外,我正在运行一个使用 vertx periodic 的调度程序,它每 15 秒查询一次 mongo。

vertx.setPeriodic(15000, r -> someService.check()); // Every 15 seconds

最佳答案

似乎没有足够的熵(服务器空闲)来提供 PRNG。因此,SecureRandom.generateSeed 方法不会快速返回,而是会阻塞,直到它获得足够的数据。

根据您的硬件,您可以使用 rng-tools 来加快该过程.

关于vert.x - Vertx 线程阻塞警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47708516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com