httpclient allows request to be created in a context other than the one an httpclient was instantiated in resulting in a deadlock on pumping.
Hi there,
Here's a reproducer for #2287. Perhaps it would make sense to bind an http client request to the context in which it is created (like AyncFile) instead of the context in which it's first used or throw an exception. In my case this is only an issue in tests since I need to access some of the internal sfs api associated with a verticle instance. Another option could enhance the vertx unit artifact by creating a rule to deploy a verticle and allow a test to be run in the context of a verticle instead of the context of the RunTestOnContext rule so that resources initialized for a test (AsyncFile) could be pumped to an http client request that made an initial connection using a verticle context. The example below is trivial... in a more complex application, it becomes difficult to manage the current behavior during test execution. A non trivial example of an api might look like volumeReplicaGroup.consume(size, newArrayList(MD5, SHA512), asyncFile) and the http clients used internally by the volume replica group may or may not already be bound to the verticle context instead of the test context asycFile is bound to (it would depend on if the verticle had attempted to use the client).
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.file.AsyncFile;
import io.vertx.core.file.OpenOptions;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.streams.Pump;
import io.vertx.core.streams.WriteStream;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.RunTestOnContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@RunWith(VertxUnitRunner.class)
public class Reproducer {
@Rule
public RunTestOnContext runTestOnContext = new RunTestOnContext();
@Test
public void testClientVerticlePumpsToServerVerticle(TestContext testContext) throws IOException, NoSuchAlgorithmException {
final byte[] data = new byte[256];
SecureRandom.getInstanceStrong().nextBytes(data);
int dataSize = 256 * 1024 * 1024;
final Path tempFile = Files.createTempFile("", "");
int bytesWritten = 0;
try (OutputStream out = Files.newOutputStream(tempFile)) {
while (bytesWritten < dataSize) {
out.write(data);
bytesWritten += data.length;
}
}
Async async = testContext.async();
Vertx vertx = runTestOnContext.vertx();
TestVerticleClient testVerticleClient = new TestVerticleClient();
TestVerticleServer testVerticleServer = new TestVerticleServer();
OpenOptions openOptions = new OpenOptions();
openOptions.setRead(true);
AsyncFile asyncFile = vertx.fileSystem().openBlocking(tempFile.toString(), openOptions);
vertx.deployVerticle(testVerticleServer, serverDeployment -> {
if (serverDeployment.failed()) {
testContext.fail(serverDeployment.cause());
}
vertx.deployVerticle(testVerticleClient, clientDeployment -> {
if (clientDeployment.failed()) {
testContext.fail(clientDeployment.cause());
}
try {
HttpClient clientVerticleHttpClient = testVerticleClient.getHttpClient();
HttpClientRequest httpClientRequest = clientVerticleHttpClient.post("/", httpClientResponse -> {
testContext.assertEquals(200, httpClientResponse.statusCode());
async.complete();
}).exceptionHandler(testContext::fail)
.putHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dataSize))
.setTimeout(10000);
asyncFile.endHandler(aVoid -> httpClientRequest.end());
asyncFile.exceptionHandler(testContext::fail);
Pump pump = Pump.pump(asyncFile, httpClientRequest);
pump.start();
} catch (Throwable e) {
testContext.fail(e);
}
});
});
}
public static class TestVerticleClient extends AbstractVerticle {
private HttpClient httpClient;
@Override
public void start(Future<Void> startFuture) {
HttpClientOptions httpClientOptions = new HttpClientOptions();
httpClientOptions.setDefaultHost("127.0.0.1");
httpClientOptions.setDefaultPort(9999);
httpClient = getVertx().createHttpClient(httpClientOptions);
httpClient.post("/", event -> {
System.out.println("Quick ping to associate connection to this context. If this is not done then no deadlock happens");
startFuture.complete();
}).setTimeout(20000)
.exceptionHandler(startFuture::fail)
.end();
}
public HttpClient getHttpClient() {
return httpClient;
}
public Context getContext() {
return context;
}
}
public static class TestVerticleServer extends AbstractVerticle {
@Override
public void start(Future<Void> startFuture) {
HttpServerOptions httpServerOptions = new HttpServerOptions();
HttpServer httpServer = getVertx().createHttpServer(httpServerOptions).requestHandler(httpServerRequest -> {
System.out.println("Server Received Request");
httpServerRequest.pause();
httpServerRequest.endHandler(event -> {
System.out.println("Server Ended Request");
httpServerRequest.response()
.setStatusCode(HttpURLConnection.HTTP_OK)
.end();
});
Pump pump = Pump.pump(httpServerRequest, new NullWriteStream());
pump.start();
httpServerRequest.resume();
});
httpServer.listen(9999, "127.0.0.1", event -> {
if (event.failed()) {
startFuture.fail(event.cause());
} else {
System.out.println("Server is listening on 127.0.0.1:9999");
startFuture.complete();
}
});
}
public Context getContext() {
return context;
}
}
public static class NullWriteStream implements WriteStream<Buffer> {
private boolean dirty = false;
private boolean ended = false;
private Handler<Void> drainHandler;
private Handler<Void> endHandler;
public NullWriteStream() {
}
@Override
public NullWriteStream write(Buffer data) {
dirty = true;
handleDrain();
return this;
}
@Override
public NullWriteStream exceptionHandler(Handler<Throwable> handler) {
return this;
}
@Override
public NullWriteStream setWriteQueueMaxSize(int maxSize) {
return this;
}
@Override
public boolean writeQueueFull() {
return false;
}
@Override
public NullWriteStream drainHandler(Handler<Void> handler) {
this.drainHandler = handler;
handleDrain();
return this;
}
@Override
public void end(Buffer buffer) {
ended = true;
handleEnd();
}
@Override
public void end() {
ended = true;
handleEnd();
}
protected void handleDrain() {
if (dirty) {
dirty = false;
Handler<Void> handler = drainHandler;
if (handler != null) {
drainHandler = null;
handler.handle(null);
}
}
}
protected void handleEnd() {
if (ended) {
Handler<Void> handler = endHandler;
if (handler != null) {
endHandler = null;
handler.handle(null);
}
}
}
}
}
can you try with latest 3.5.1-SNAPSHOT ?
The deadlock doesn't occur in 3.5.1-SNAPSHOT.
ok will have a look thanks
can you post the stack trace dump when it deadlocks that would help to understand what is going on.
Here's the deadlock on 3.5.0 which I can't reproduce on 3.5.1-SNAPSHOT
2018-01-23 11:31:20,509 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2018-01-23 11:31:20,512 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
2018-01-23 11:31:20,513 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.maxRecords: 4
2018-01-23 11:31:20,549 [main] DEBUG i.n.c.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 8
2018-01-23 11:31:20,575 [main] DEBUG i.n.util.internal.PlatformDependent - Platform: MacOS
2018-01-23 11:31:20,577 [main] DEBUG i.n.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
2018-01-23 11:31:20,579 [main] DEBUG i.n.util.internal.PlatformDependent0 - Java version: 8
2018-01-23 11:31:20,581 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
2018-01-23 11:31:20,582 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
2018-01-23 11:31:20,583 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
2018-01-23 11:31:20,583 [main] DEBUG i.n.util.internal.PlatformDependent0 - direct buffer constructor: available
2018-01-23 11:31:20,584 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
2018-01-23 11:31:20,584 [main] DEBUG i.n.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
2018-01-23 11:31:20,584 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available
2018-01-23 11:31:20,584 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
2018-01-23 11:31:20,585 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /var/folders/wd/wm4qt9s55n56v_v1xc0mm2mr0000gn/T (java.io.tmpdir)
2018-01-23 11:31:20,585 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
2018-01-23 11:31:20,587 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
2018-01-23 11:31:20,587 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 3817865216 bytes
2018-01-23 11:31:20,587 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
2018-01-23 11:31:20,587 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available
2018-01-23 11:31:20,628 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
2018-01-23 11:31:20,628 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
2018-01-23 11:31:20,641 [main] DEBUG i.n.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
2018-01-23 11:31:20,698 [main] DEBUG i.n.r.d.DefaultDnsServerAddressStreamProvider - Default DNS servers: [/192.168.2.1:53] (sun.net.dns.ResolverConfiguration)
2018-01-23 11:31:20,702 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
2018-01-23 11:31:20,702 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
2018-01-23 11:31:20,703 [main] DEBUG io.netty.util.NetUtil - Loopback interface: lo0 (lo0, 0:0:0:0:0:0:0:1)
2018-01-23 11:31:20,704 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file /proc/sys/net/core/somaxconn. Default: 128
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 8
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 8
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
2018-01-23 11:31:29,566 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
2018-01-23 11:31:29,567 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
2018-01-23 11:31:29,567 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true
2018-01-23 11:31:29,570 [vert.x-eventloop-thread-1] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
2018-01-23 11:31:29,570 [vert.x-eventloop-thread-1] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
2018-01-23 11:31:29,653 [vert.x-eventloop-thread-1] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 7590 (auto-detected)
2018-01-23 11:31:29,665 [vert.x-eventloop-thread-1] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 6c:40:08:ff:fe:8b:23:fe (auto-detected)
2018-01-23 11:31:29,691 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
2018-01-23 11:31:29,692 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 65536
2018-01-23 11:31:29,692 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
Server is listening on 127.0.0.1:9999
2018-01-23 11:31:29,787 [vert.x-eventloop-thread-2] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.bytebuf.checkAccessible: true
2018-01-23 11:31:29,790 [vert.x-eventloop-thread-2] DEBUG i.n.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@73ebe744
2018-01-23 11:31:29,846 [vert.x-eventloop-thread-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 32768
2018-01-23 11:31:29,846 [vert.x-eventloop-thread-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2
2018-01-23 11:31:29,847 [vert.x-eventloop-thread-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16
2018-01-23 11:31:29,847 [vert.x-eventloop-thread-2] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8
Server Received Request
Server Ended Request
Quick ping to associate connection to this context. If this is not done then no deadlock happens
Server Received Request
2018-01-23 11:31:33
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):
"vert.x-worker-thread-19" #37 prio=5 os_prio=31 tid=0x00007fdee0cda000 nid=0x6703 waiting on condition [0x0000700007c47000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-18" #36 prio=5 os_prio=31 tid=0x00007fdedfa0e800 nid=0x9303 waiting on condition [0x0000700007bc4000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-17" #35 prio=5 os_prio=31 tid=0x00007fdee0451800 nid=0x6603 waiting on condition [0x0000700007b41000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-16" #34 prio=5 os_prio=31 tid=0x00007fdee144e000 nid=0x6403 waiting on condition [0x0000700007abe000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-15" #33 prio=5 os_prio=31 tid=0x00007fdee144d000 nid=0x6203 waiting on condition [0x0000700007a3b000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-14" #32 prio=5 os_prio=31 tid=0x00007fdedfa0e000 nid=0x6103 waiting on condition [0x00007000079b8000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-13" #31 prio=5 os_prio=31 tid=0x00007fdee144a800 nid=0x6003 waiting on condition [0x0000700007935000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-12" #30 prio=5 os_prio=31 tid=0x00007fdedfa0d000 nid=0x9803 waiting on condition [0x00007000078b2000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-11" #29 prio=5 os_prio=31 tid=0x00007fdee1445800 nid=0x9a03 waiting on condition [0x000070000782f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-10" #28 prio=5 os_prio=31 tid=0x00007fdee129e000 nid=0x5f03 waiting on condition [0x00007000077ac000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-9" #27 prio=5 os_prio=31 tid=0x00007fdee0cd3800 nid=0x9d03 waiting on condition [0x0000700007729000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-8" #26 prio=5 os_prio=31 tid=0x00007fdedf86a000 nid=0x5e03 waiting on condition [0x00007000076a6000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-7" #25 prio=5 os_prio=31 tid=0x00007fdee08d3800 nid=0x5c03 waiting on condition [0x0000700007623000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-6" #24 prio=5 os_prio=31 tid=0x00007fdee13e6000 nid=0x9f03 waiting on condition [0x00007000075a0000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-5" #23 prio=5 os_prio=31 tid=0x00007fdee0450800 nid=0xa003 waiting on condition [0x000070000751d000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-4" #22 prio=5 os_prio=31 tid=0x00007fdee0a40800 nid=0xa103 waiting on condition [0x000070000749a000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-3" #21 prio=5 os_prio=31 tid=0x00007fdedfc9c800 nid=0xa303 waiting on condition [0x0000700007417000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-2" #20 prio=5 os_prio=31 tid=0x00007fdedfc9c000 nid=0xa403 waiting on condition [0x0000700007394000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-1" #19 prio=5 os_prio=31 tid=0x00007fdee12bb800 nid=0xa603 waiting on condition [0x0000700007311000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-0" #18 prio=5 os_prio=31 tid=0x00007fdee0471000 nid=0xa703 waiting on condition [0x000070000728e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b88920> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"threadDeathWatcher-2-1" #17 daemon prio=1 os_prio=31 tid=0x00007fdee0c00800 nid=0xa803 waiting on condition [0x000070000720b000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at io.netty.util.ThreadDeathWatcher$Watcher.run(ThreadDeathWatcher.java:152)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-2" #16 prio=5 os_prio=31 tid=0x00007fdedf869000 nid=0x5503 waiting for monitor entry [0x0000700007187000]
java.lang.Thread.State: BLOCKED (on object monitor)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:252)
- waiting to lock <0x0000000772c3d350> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:57)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$0(PumpImpl.java:62)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$56/159218093.handle(Unknown Source)
at io.vertx.core.http.impl.HttpClientRequestImpl.handleDrained(HttpClientRequestImpl.java:438)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.ClientConnection.handleInterestedOpsChanged(ClientConnection.java:273)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.VertxHandler$$Lambda$68/562561628.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:200)
at io.vertx.core.net.impl.VertxHandler.channelWritabilityChanged(VertxHandler.java:104)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelWritabilityChanged(CombinedChannelDuplexHandler.java:450)
at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
at io.netty.channel.CombinedChannelDuplexHandler.channelWritabilityChanged(CombinedChannelDuplexHandler.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelWritabilityChanged(DefaultChannelPipeline.java:1382)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.DefaultChannelPipeline.fireChannelWritabilityChanged(DefaultChannelPipeline.java:947)
at io.netty.channel.ChannelOutboundBuffer.fireChannelWritabilityChanged(ChannelOutboundBuffer.java:584)
at io.netty.channel.ChannelOutboundBuffer.setWritable(ChannelOutboundBuffer.java:550)
at io.netty.channel.ChannelOutboundBuffer.decrementPendingOutboundBytes(ChannelOutboundBuffer.java:193)
at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:258)
at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:337)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:449)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:875)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:842)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1321)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush(CombinedChannelDuplexHandler.java:533)
at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
at io.netty.channel.CombinedChannelDuplexHandler.flush(CombinedChannelDuplexHandler.java:358)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794)
at io.vertx.core.net.impl.ConnectionBase.write(ConnectionBase.java:100)
at io.vertx.core.net.impl.ConnectionBase.lambda$queueForWrite$0(ConnectionBase.java:121)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.ConnectionBase$$Lambda$67/163585266.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-acceptor-thread-0" #15 prio=5 os_prio=31 tid=0x00007fdee1338800 nid=0xd07 runnable [0x000070000634f000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:103)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000772b904f8> (a io.netty.channel.nio.SelectedSelectionKeySet)
- locked <0x0000000772b90510> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000772b904a8> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:753)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:409)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-1" #14 prio=5 os_prio=31 tid=0x00007fdee0ba2000 nid=0xe07 runnable [0x00007000062cc000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:103)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000772c3dc18> (a io.netty.channel.nio.SelectedSelectionKeySet)
- locked <0x0000000772c4f198> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000772c3db68> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:753)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:409)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-unit-timeout-thread-1" #13 prio=5 os_prio=31 tid=0x00007fdee0a35000 nid=0x3b03 in Object.wait() [0x0000700007105000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772b80908> (a io.vertx.ext.unit.impl.TestContextImpl$Step)
at io.vertx.ext.unit.impl.TestContextImpl$Step.lambda$run$0(TestContextImpl.java:106)
- locked <0x0000000772b80908> (a io.vertx.ext.unit.impl.TestContextImpl$Step)
at io.vertx.ext.unit.impl.TestContextImpl$Step$$Lambda$14/1639331685.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-0" #12 prio=5 os_prio=31 tid=0x00007fdee1341800 nid=0x3903 waiting for monitor entry [0x0000700007082000]
java.lang.Thread.State: BLOCKED (on object monitor)
at io.vertx.core.http.impl.HttpClientRequestImpl.writeQueueFull(HttpClientRequestImpl.java:266)
- waiting to lock <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$1(PumpImpl.java:66)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$57/1286326964.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl.handleData(AsyncFileImpl.java:352)
- locked <0x0000000772c3d350> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.lambda$doRead$2(AsyncFileImpl.java:337)
at io.vertx.core.file.impl.AsyncFileImpl$$Lambda$64/1860805575.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl$2.lambda$done$0(AsyncFileImpl.java:430)
at io.vertx.core.file.impl.AsyncFileImpl$2$$Lambda$65/788326174.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vertx-blocked-thread-checker" #10 daemon prio=5 os_prio=31 tid=0x00007fdedfbb4000 nid=0x3e03 in Object.wait() [0x0000700006fff000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772b9a5e0> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:552)
- locked <0x0000000772b9a5e0> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:505)
"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fdee0050000 nid=0x4103 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread2" #8 daemon prio=9 os_prio=31 tid=0x00007fdee004a000 nid=0x4203 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" #7 daemon prio=9 os_prio=31 tid=0x00007fdee0832800 nid=0x4403 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #6 daemon prio=9 os_prio=31 tid=0x00007fdedf839000 nid=0x4503 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Monitor Ctrl-Break" #5 daemon prio=5 os_prio=31 tid=0x00007fdedf837800 nid=0x3403 runnable [0x0000700006aed000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
- locked <0x0000000772c54b78> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
- locked <0x0000000772c54b78> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)
"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fdee0832000 nid=0x3307 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fdee003b000 nid=0x2c03 in Object.wait() [0x00007000069e7000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772c60b20> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
- locked <0x0000000772c60b20> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fdee003a800 nid=0x4f03 in Object.wait() [0x0000700006964000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772c60d38> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
- locked <0x0000000772c60d38> (a java.lang.ref.Reference$Lock)
"main" #1 prio=5 os_prio=31 tid=0x00007fdee1008000 nid=0x2703 waiting on condition [0x00007000063d1000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772c60db8> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1685)
at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3320)
at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1721)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1887)
at io.vertx.ext.unit.junit.VertxUnitRunner.invokeExplosively(VertxUnitRunner.java:134)
at io.vertx.ext.unit.junit.VertxUnitRunner.access$000(VertxUnitRunner.java:39)
at io.vertx.ext.unit.junit.VertxUnitRunner$1.evaluate(VertxUnitRunner.java:84)
at io.vertx.ext.unit.junit.RunTestOnContext$1.evaluate(RunTestOnContext.java:93)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
"VM Thread" os_prio=31 tid=0x00007fdee0038000 nid=0x2b03 runnable
"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fdee000d800 nid=0x2007 runnable
"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fdedf802800 nid=0x1f03 runnable
"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fdedf803000 nid=0x5403 runnable
"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fdedf803800 nid=0x5203 runnable
"VM Periodic Task Thread" os_prio=31 tid=0x00007fdee1039000 nid=0x3703 waiting on condition
JNI global references: 528
Found one Java-level deadlock:
=============================
"vert.x-eventloop-thread-2":
waiting to lock monitor 0x00007fdee12dcea8 (object 0x0000000772c3d350, a io.vertx.core.file.impl.AsyncFileImpl),
which is held by "vert.x-eventloop-thread-0"
"vert.x-eventloop-thread-0":
waiting to lock monitor 0x00007fdee12d8a98 (object 0x0000000772c4af88, a io.vertx.core.http.impl.ClientConnection),
which is held by "vert.x-eventloop-thread-2"
Java stack information for the threads listed above:
===================================================
"vert.x-eventloop-thread-2":
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:252)
- waiting to lock <0x0000000772c3d350> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:57)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$0(PumpImpl.java:62)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$56/159218093.handle(Unknown Source)
at io.vertx.core.http.impl.HttpClientRequestImpl.handleDrained(HttpClientRequestImpl.java:438)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.ClientConnection.handleInterestedOpsChanged(ClientConnection.java:273)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.VertxHandler$$Lambda$68/562561628.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:200)
at io.vertx.core.net.impl.VertxHandler.channelWritabilityChanged(VertxHandler.java:104)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelWritabilityChanged(CombinedChannelDuplexHandler.java:450)
at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
at io.netty.channel.CombinedChannelDuplexHandler.channelWritabilityChanged(CombinedChannelDuplexHandler.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelWritabilityChanged(DefaultChannelPipeline.java:1382)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.DefaultChannelPipeline.fireChannelWritabilityChanged(DefaultChannelPipeline.java:947)
at io.netty.channel.ChannelOutboundBuffer.fireChannelWritabilityChanged(ChannelOutboundBuffer.java:584)
at io.netty.channel.ChannelOutboundBuffer.setWritable(ChannelOutboundBuffer.java:550)
at io.netty.channel.ChannelOutboundBuffer.decrementPendingOutboundBytes(ChannelOutboundBuffer.java:193)
at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:258)
at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:337)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:449)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:875)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:842)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1321)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush(CombinedChannelDuplexHandler.java:533)
at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
at io.netty.channel.CombinedChannelDuplexHandler.flush(CombinedChannelDuplexHandler.java:358)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794)
at io.vertx.core.net.impl.ConnectionBase.write(ConnectionBase.java:100)
at io.vertx.core.net.impl.ConnectionBase.lambda$queueForWrite$0(ConnectionBase.java:121)
- locked <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.ConnectionBase$$Lambda$67/163585266.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-0":
at io.vertx.core.http.impl.HttpClientRequestImpl.writeQueueFull(HttpClientRequestImpl.java:266)
- waiting to lock <0x0000000772c4af88> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$1(PumpImpl.java:66)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$57/1286326964.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl.handleData(AsyncFileImpl.java:352)
- locked <0x0000000772c3d350> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.lambda$doRead$2(AsyncFileImpl.java:337)
at io.vertx.core.file.impl.AsyncFileImpl$$Lambda$64/1860805575.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl$2.lambda$done$0(AsyncFileImpl.java:430)
at io.vertx.core.file.impl.AsyncFileImpl$2$$Lambda$65/788326174.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
Found 1 deadlock.
Heap
PSYoungGen total 153088K, used 41220K [0x000000076ab00000, 0x0000000775580000, 0x00000007c0000000)
eden space 131584K, 21% used [0x000000076ab00000,0x000000076c6ecfd8,0x0000000772b80000)
from space 21504K, 58% used [0x0000000772b80000,0x00000007737d4358,0x0000000774080000)
to space 21504K, 0% used [0x0000000774080000,0x0000000774080000,0x0000000775580000)
ParOldGen total 349696K, used 88K [0x00000006c0000000, 0x00000006d5580000, 0x000000076ab00000)
object space 349696K, 0% used [0x00000006c0000000,0x00000006c0016010,0x00000006d5580000)
Metaspace used 18895K, capacity 19424K, committed 19712K, reserved 1067008K
class space used 2311K, capacity 2438K, committed 2560K, reserved 1048576K
what's the purpose of TestVerticleClient ?
To replicate something similar to https://github.com/pitchpoint-solutions/sfs/blob/master/sfs-server/src/main/java/org/sfs/SfsServer.java. I suppose I could have made the test simpler with only one verticle... apologies. In one of the tests I'm attempting to test functionality that internally uses an http client bound to the verticle context by pumping file opened in the test context. The http client becomes bound to the server verticle context only if it's used in that context before the test context.
Here's a less convoluted reproducer
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.file.AsyncFile;
import io.vertx.core.file.OpenOptions;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.streams.Pump;
import io.vertx.core.streams.WriteStream;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.RunTestOnContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@RunWith(VertxUnitRunner.class)
public class Reproducer {
@Rule
public RunTestOnContext runTestOnContext = new RunTestOnContext();
@Test
public void testDeadLock(TestContext testContext) throws IOException, NoSuchAlgorithmException {
final byte[] data = new byte[256];
SecureRandom.getInstanceStrong().nextBytes(data);
int dataSize = 256 * 1024 * 1024;
final Path tempFile = Files.createTempFile("", "");
int bytesWritten = 0;
try (OutputStream out = Files.newOutputStream(tempFile)) {
while (bytesWritten < dataSize) {
out.write(data);
bytesWritten += data.length;
}
}
Async async = testContext.async();
Vertx vertx = runTestOnContext.vertx();
TestVerticle testVerticle = new TestVerticle();
OpenOptions openOptions = new OpenOptions();
openOptions.setRead(true);
AsyncFile asyncFile = vertx.fileSystem().openBlocking(tempFile.toString(), openOptions);
vertx.deployVerticle(testVerticle, clientDeployment -> {
if (clientDeployment.failed()) {
testContext.fail(clientDeployment.cause());
}
try {
HttpClient httpClient = testVerticle.getHttpClient();
HttpClientRequest httpClientRequest = httpClient.post("/", httpClientResponse -> {
testContext.assertEquals(200, httpClientResponse.statusCode());
async.complete();
}).exceptionHandler(testContext::fail)
.putHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dataSize))
.setTimeout(10000);
asyncFile.endHandler(aVoid -> httpClientRequest.end());
asyncFile.exceptionHandler(testContext::fail);
Pump pump = Pump.pump(asyncFile, httpClientRequest);
pump.start();
} catch (Throwable e) {
testContext.fail(e);
}
});
}
public static class TestVerticle extends AbstractVerticle {
private HttpClient httpClient;
@Override
public void start(Future<Void> startFuture) {
HttpServerOptions httpServerOptions = new HttpServerOptions();
HttpServer httpServer = getVertx().createHttpServer(httpServerOptions).requestHandler(httpServerRequest -> {
System.out.println("Server Received Request");
httpServerRequest.pause();
httpServerRequest.endHandler(event -> {
System.out.println("Server Ended Request");
httpServerRequest.response()
.setStatusCode(HttpURLConnection.HTTP_OK)
.end();
});
Pump pump = Pump.pump(httpServerRequest, new NullWriteStream());
pump.start();
httpServerRequest.resume();
});
httpServer.listen(9999, "127.0.0.1", event -> {
if (event.failed()) {
startFuture.fail(event.cause());
} else {
System.out.println("Server is listening on 127.0.0.1:9999");
HttpClientOptions httpClientOptions = new HttpClientOptions();
httpClientOptions.setDefaultHost("127.0.0.1");
httpClientOptions.setDefaultPort(9999);
httpClient = getVertx().createHttpClient(httpClientOptions);
httpClient.post("/", httpClientResponse -> {
System.out.println("Quick ping to associate connection to this context. If this is not done then no deadlock happens");
startFuture.complete();
}).setTimeout(20000)
.exceptionHandler(startFuture::fail)
.end();
}
});
}
public HttpClient getHttpClient() {
return httpClient;
}
public Context getContext() {
return context;
}
}
public static class TestVerticleServer extends AbstractVerticle {
@Override
public void start(Future<Void> startFuture) {
}
public Context getContext() {
return context;
}
}
public static class NullWriteStream implements WriteStream<Buffer> {
private boolean dirty = false;
private boolean ended = false;
private Handler<Void> drainHandler;
private Handler<Void> endHandler;
public NullWriteStream() {
}
@Override
public NullWriteStream write(Buffer data) {
dirty = true;
handleDrain();
return this;
}
@Override
public NullWriteStream exceptionHandler(Handler<Throwable> handler) {
return this;
}
@Override
public NullWriteStream setWriteQueueMaxSize(int maxSize) {
return this;
}
@Override
public boolean writeQueueFull() {
return false;
}
@Override
public NullWriteStream drainHandler(Handler<Void> handler) {
this.drainHandler = handler;
handleDrain();
return this;
}
@Override
public void end(Buffer buffer) {
ended = true;
handleEnd();
}
@Override
public void end() {
ended = true;
handleEnd();
}
protected void handleDrain() {
if (dirty) {
dirty = false;
Handler<Void> handler = drainHandler;
if (handler != null) {
drainHandler = null;
handler.handle(null);
}
}
}
protected void handleEnd() {
if (ended) {
Handler<Void> handler = endHandler;
if (handler != null) {
endHandler = null;
handler.handle(null);
}
}
}
}
}
and the resulting deadlock
2018-01-23 11:53:44,921 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2018-01-23 11:53:44,925 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
2018-01-23 11:53:44,927 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.maxRecords: 4
2018-01-23 11:53:44,944 [main] DEBUG i.n.c.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 8
2018-01-23 11:53:44,968 [main] DEBUG i.n.util.internal.PlatformDependent - Platform: MacOS
2018-01-23 11:53:44,969 [main] DEBUG i.n.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
2018-01-23 11:53:44,970 [main] DEBUG i.n.util.internal.PlatformDependent0 - Java version: 8
2018-01-23 11:53:44,971 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
2018-01-23 11:53:44,972 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
2018-01-23 11:53:44,972 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
2018-01-23 11:53:44,973 [main] DEBUG i.n.util.internal.PlatformDependent0 - direct buffer constructor: available
2018-01-23 11:53:44,973 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
2018-01-23 11:53:44,973 [main] DEBUG i.n.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
2018-01-23 11:53:44,973 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available
2018-01-23 11:53:44,973 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
2018-01-23 11:53:44,974 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /var/folders/wd/wm4qt9s55n56v_v1xc0mm2mr0000gn/T (java.io.tmpdir)
2018-01-23 11:53:44,974 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
2018-01-23 11:53:44,975 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
2018-01-23 11:53:44,976 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 3817865216 bytes
2018-01-23 11:53:44,976 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
2018-01-23 11:53:44,976 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available
2018-01-23 11:53:45,001 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
2018-01-23 11:53:45,002 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
2018-01-23 11:53:45,011 [main] DEBUG i.n.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
2018-01-23 11:53:45,062 [main] DEBUG i.n.r.d.DefaultDnsServerAddressStreamProvider - Default DNS servers: [/192.168.2.1:53] (sun.net.dns.ResolverConfiguration)
2018-01-23 11:53:45,066 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
2018-01-23 11:53:45,066 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
2018-01-23 11:53:45,068 [main] DEBUG io.netty.util.NetUtil - Loopback interface: lo0 (lo0, 0:0:0:0:0:0:0:1)
2018-01-23 11:53:45,068 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file /proc/sys/net/core/somaxconn. Default: 128
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 8
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 8
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
2018-01-23 11:53:53,628 [vert.x-eventloop-thread-1] DEBUG i.n.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true
2018-01-23 11:53:53,631 [vert.x-eventloop-thread-1] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
2018-01-23 11:53:53,631 [vert.x-eventloop-thread-1] DEBUG i.n.u.i.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
2018-01-23 11:53:53,715 [vert.x-eventloop-thread-1] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 8030 (auto-detected)
2018-01-23 11:53:53,718 [vert.x-eventloop-thread-1] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 6c:40:08:ff:fe:8b:23:fe (auto-detected)
2018-01-23 11:53:53,738 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
2018-01-23 11:53:53,738 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 65536
2018-01-23 11:53:53,738 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
Server is listening on 127.0.0.1:9999
2018-01-23 11:53:53,817 [vert.x-eventloop-thread-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.bytebuf.checkAccessible: true
2018-01-23 11:53:53,818 [vert.x-eventloop-thread-1] DEBUG i.n.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@49d0eeb5
2018-01-23 11:53:53,856 [vert.x-eventloop-thread-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 32768
2018-01-23 11:53:53,856 [vert.x-eventloop-thread-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2
2018-01-23 11:53:53,856 [vert.x-eventloop-thread-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16
2018-01-23 11:53:53,856 [vert.x-eventloop-thread-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8
Server Received Request
Server Ended Request
Quick ping to associate connection to this context. If this is not done then no deadlock happens
Server Received Request
2018-01-23 11:53:58
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):
"vert.x-worker-thread-19" #36 prio=5 os_prio=31 tid=0x00007ff4769fd800 nid=0x9303 waiting on condition [0x00007000110da000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-18" #35 prio=5 os_prio=31 tid=0x00007ff4769fc800 nid=0x9503 waiting on condition [0x0000700011057000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-17" #34 prio=5 os_prio=31 tid=0x00007ff476468000 nid=0x6603 waiting on condition [0x0000700010fd4000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-16" #33 prio=5 os_prio=31 tid=0x00007ff4769fc000 nid=0x9603 waiting on condition [0x0000700010f51000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-15" #32 prio=5 os_prio=31 tid=0x00007ff47657e000 nid=0x9803 waiting on condition [0x0000700010ece000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-14" #31 prio=5 os_prio=31 tid=0x00007ff4770e0000 nid=0x6303 waiting on condition [0x0000700010e4b000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-13" #30 prio=5 os_prio=31 tid=0x00007ff47657d800 nid=0x9903 waiting on condition [0x0000700010dc8000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-12" #29 prio=5 os_prio=31 tid=0x00007ff47657a800 nid=0x9b03 waiting on condition [0x0000700010d45000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-11" #28 prio=5 os_prio=31 tid=0x00007ff476578000 nid=0x9c03 waiting on condition [0x0000700010cc2000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-10" #27 prio=5 os_prio=31 tid=0x00007ff475b3a000 nid=0x9d03 waiting on condition [0x0000700010c3f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-9" #26 prio=5 os_prio=31 tid=0x00007ff4770df800 nid=0x9f03 waiting on condition [0x0000700010bbc000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-8" #25 prio=5 os_prio=31 tid=0x00007ff47654b800 nid=0x5e03 waiting on condition [0x0000700010b39000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-7" #24 prio=5 os_prio=31 tid=0x00007ff477459000 nid=0x5c03 waiting on condition [0x0000700010ab6000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-6" #23 prio=5 os_prio=31 tid=0x00007ff477286800 nid=0x5b03 waiting on condition [0x0000700010a33000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-5" #22 prio=5 os_prio=31 tid=0x00007ff476c30800 nid=0x5a03 waiting on condition [0x00007000109b0000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-4" #21 prio=5 os_prio=31 tid=0x00007ff476a32000 nid=0x5903 waiting on condition [0x000070001092d000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-3" #20 prio=5 os_prio=31 tid=0x00007ff476563000 nid=0xa403 waiting on condition [0x00007000108aa000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-2" #19 prio=5 os_prio=31 tid=0x00007ff476a31800 nid=0xa603 waiting on condition [0x0000700010827000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-1" #18 prio=5 os_prio=31 tid=0x00007ff476aef000 nid=0xa803 waiting on condition [0x00007000107a4000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"vert.x-worker-thread-0" #17 prio=5 os_prio=31 tid=0x00007ff47655a000 nid=0x5803 waiting on condition [0x0000700010721000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772b80750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"threadDeathWatcher-2-1" #16 daemon prio=1 os_prio=31 tid=0x00007ff47727a000 nid=0x5603 waiting on condition [0x000070001069e000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at io.netty.util.ThreadDeathWatcher$Watcher.run(ThreadDeathWatcher.java:152)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:745)
"vert.x-acceptor-thread-0" #15 prio=5 os_prio=31 tid=0x00007ff475a5c000 nid=0xf07 runnable [0x000070000f865000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:103)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000772b985e0> (a io.netty.channel.nio.SelectedSelectionKeySet)
- locked <0x0000000772b985f8> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000772b98590> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:753)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:409)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-1" #14 prio=5 os_prio=31 tid=0x00007ff476420800 nid=0x1307 waiting for monitor entry [0x000070000f7e1000]
java.lang.Thread.State: BLOCKED (on object monitor)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:252)
- waiting to lock <0x0000000772c4e3f8> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:57)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$0(PumpImpl.java:62)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$54/508561550.handle(Unknown Source)
at io.vertx.core.http.impl.HttpClientRequestImpl.handleDrained(HttpClientRequestImpl.java:438)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.ClientConnection.handleInterestedOpsChanged(ClientConnection.java:273)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.VertxHandler$$Lambda$67/1827548045.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:200)
at io.vertx.core.net.impl.VertxHandler.channelWritabilityChanged(VertxHandler.java:104)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelWritabilityChanged(CombinedChannelDuplexHandler.java:450)
at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
at io.netty.channel.CombinedChannelDuplexHandler.channelWritabilityChanged(CombinedChannelDuplexHandler.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelWritabilityChanged(DefaultChannelPipeline.java:1382)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.DefaultChannelPipeline.fireChannelWritabilityChanged(DefaultChannelPipeline.java:947)
at io.netty.channel.ChannelOutboundBuffer.fireChannelWritabilityChanged(ChannelOutboundBuffer.java:584)
at io.netty.channel.ChannelOutboundBuffer.setWritable(ChannelOutboundBuffer.java:550)
at io.netty.channel.ChannelOutboundBuffer.decrementPendingOutboundBytes(ChannelOutboundBuffer.java:193)
at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:258)
at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:337)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:449)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:875)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:842)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1321)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush(CombinedChannelDuplexHandler.java:533)
at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
at io.netty.channel.CombinedChannelDuplexHandler.flush(CombinedChannelDuplexHandler.java:358)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794)
at io.vertx.core.net.impl.ConnectionBase.write(ConnectionBase.java:100)
at io.vertx.core.net.impl.ConnectionBase.lambda$queueForWrite$0(ConnectionBase.java:121)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.ConnectionBase$$Lambda$66/208693156.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-unit-timeout-thread-1" #13 prio=5 os_prio=31 tid=0x00007ff476a9b800 nid=0x4303 in Object.wait() [0x000070001061b000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772b90c48> (a io.vertx.ext.unit.impl.TestContextImpl$Step)
at io.vertx.ext.unit.impl.TestContextImpl$Step.lambda$run$0(TestContextImpl.java:106)
- locked <0x0000000772b90c48> (a io.vertx.ext.unit.impl.TestContextImpl$Step)
at io.vertx.ext.unit.impl.TestContextImpl$Step$$Lambda$14/1802648846.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-0" #12 prio=5 os_prio=31 tid=0x00007ff47639c000 nid=0x4103 waiting for monitor entry [0x0000700010598000]
java.lang.Thread.State: BLOCKED (on object monitor)
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:223)
- waiting to lock <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:51)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$1(PumpImpl.java:64)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$55/583324824.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl.handleData(AsyncFileImpl.java:352)
- locked <0x0000000772c4e3f8> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.lambda$doRead$2(AsyncFileImpl.java:337)
at io.vertx.core.file.impl.AsyncFileImpl$$Lambda$63/1052855952.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl$2.lambda$done$0(AsyncFileImpl.java:430)
at io.vertx.core.file.impl.AsyncFileImpl$2$$Lambda$64/753719266.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vertx-blocked-thread-checker" #10 daemon prio=5 os_prio=31 tid=0x00007ff475b46800 nid=0x4003 in Object.wait() [0x0000700010515000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772b90e00> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:552)
- locked <0x0000000772b90e00> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:505)
"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007ff475814800 nid=0x4603 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread2" #8 daemon prio=9 os_prio=31 tid=0x00007ff47602d800 nid=0x3b03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" #7 daemon prio=9 os_prio=31 tid=0x00007ff47602c800 nid=0x4803 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #6 daemon prio=9 os_prio=31 tid=0x00007ff47602c000 nid=0x3903 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Monitor Ctrl-Break" #5 daemon prio=5 os_prio=31 tid=0x00007ff476026000 nid=0x3703 runnable [0x0000700010003000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
- locked <0x0000000772b977d0> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
- locked <0x0000000772b977d0> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)
"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007ff475832800 nid=0x4a03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007ff476024000 nid=0x5103 in Object.wait() [0x000070000fefd000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772b989c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
- locked <0x0000000772b989c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007ff476008000 nid=0x2e03 in Object.wait() [0x000070000fe7a000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000772ba0a08> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
- locked <0x0000000772ba0a08> (a java.lang.ref.Reference$Lock)
"main" #1 prio=5 os_prio=31 tid=0x00007ff476009000 nid=0x2603 waiting on condition [0x000070000f8e7000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000772ba0a88> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1685)
at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3320)
at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1721)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1887)
at io.vertx.ext.unit.junit.VertxUnitRunner.invokeExplosively(VertxUnitRunner.java:134)
at io.vertx.ext.unit.junit.VertxUnitRunner.access$000(VertxUnitRunner.java:39)
at io.vertx.ext.unit.junit.VertxUnitRunner$1.evaluate(VertxUnitRunner.java:84)
at io.vertx.ext.unit.junit.RunTestOnContext$1.evaluate(RunTestOnContext.java:93)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
"VM Thread" os_prio=31 tid=0x00007ff47582a000 nid=0x2d03 runnable
"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007ff476804000 nid=0x2107 runnable
"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007ff476805000 nid=0x1f03 runnable
"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007ff476805800 nid=0x2b03 runnable
"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007ff476806000 nid=0x5403 runnable
"VM Periodic Task Thread" os_prio=31 tid=0x00007ff47600b800 nid=0x3e03 waiting on condition
JNI global references: 515
Found one Java-level deadlock:
=============================
"vert.x-eventloop-thread-1":
waiting to lock monitor 0x00007ff476a97718 (object 0x0000000772c4e3f8, a io.vertx.core.file.impl.AsyncFileImpl),
which is held by "vert.x-eventloop-thread-0"
"vert.x-eventloop-thread-0":
waiting to lock monitor 0x00007ff476a951f8 (object 0x0000000772c4ae08, a io.vertx.core.http.impl.ClientConnection),
which is held by "vert.x-eventloop-thread-1"
Java stack information for the threads listed above:
===================================================
"vert.x-eventloop-thread-1":
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:252)
- waiting to lock <0x0000000772c4e3f8> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.resume(AsyncFileImpl.java:57)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$0(PumpImpl.java:62)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$54/508561550.handle(Unknown Source)
at io.vertx.core.http.impl.HttpClientRequestImpl.handleDrained(HttpClientRequestImpl.java:438)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.ClientConnection.handleInterestedOpsChanged(ClientConnection.java:273)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.VertxHandler$$Lambda$67/1827548045.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:200)
at io.vertx.core.net.impl.VertxHandler.channelWritabilityChanged(VertxHandler.java:104)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelWritabilityChanged(CombinedChannelDuplexHandler.java:450)
at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
at io.netty.channel.CombinedChannelDuplexHandler.channelWritabilityChanged(CombinedChannelDuplexHandler.java:273)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:409)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelWritabilityChanged(DefaultChannelPipeline.java:1382)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:416)
at io.netty.channel.DefaultChannelPipeline.fireChannelWritabilityChanged(DefaultChannelPipeline.java:947)
at io.netty.channel.ChannelOutboundBuffer.fireChannelWritabilityChanged(ChannelOutboundBuffer.java:584)
at io.netty.channel.ChannelOutboundBuffer.setWritable(ChannelOutboundBuffer.java:550)
at io.netty.channel.ChannelOutboundBuffer.decrementPendingOutboundBytes(ChannelOutboundBuffer.java:193)
at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:258)
at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:337)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:449)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:875)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:842)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1321)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush(CombinedChannelDuplexHandler.java:533)
at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
at io.netty.channel.CombinedChannelDuplexHandler.flush(CombinedChannelDuplexHandler.java:358)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794)
at io.vertx.core.net.impl.ConnectionBase.write(ConnectionBase.java:100)
at io.vertx.core.net.impl.ConnectionBase.lambda$queueForWrite$0(ConnectionBase.java:121)
- locked <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.net.impl.ConnectionBase$$Lambda$66/208693156.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
"vert.x-eventloop-thread-0":
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:223)
- waiting to lock <0x0000000772c4ae08> (a io.vertx.core.http.impl.ClientConnection)
at io.vertx.core.http.impl.HttpClientRequestImpl.write(HttpClientRequestImpl.java:51)
at io.vertx.core.streams.impl.PumpImpl.lambda$new$1(PumpImpl.java:64)
at io.vertx.core.streams.impl.PumpImpl$$Lambda$55/583324824.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl.handleData(AsyncFileImpl.java:352)
- locked <0x0000000772c4e3f8> (a io.vertx.core.file.impl.AsyncFileImpl)
at io.vertx.core.file.impl.AsyncFileImpl.lambda$doRead$2(AsyncFileImpl.java:337)
at io.vertx.core.file.impl.AsyncFileImpl$$Lambda$63/1052855952.handle(Unknown Source)
at io.vertx.core.file.impl.AsyncFileImpl$2.lambda$done$0(AsyncFileImpl.java:430)
at io.vertx.core.file.impl.AsyncFileImpl$2$$Lambda$64/753719266.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
at io.vertx.core.impl.ContextImpl$$Lambda$12/182259421.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
Found 1 deadlock.
Heap
PSYoungGen total 153088K, used 39832K [0x000000076ab00000, 0x0000000775580000, 0x00000007c0000000)
eden space 131584K, 20% used [0x000000076ab00000,0x000000076c5c39b0,0x0000000772b80000)
from space 21504K, 57% used [0x0000000772b80000,0x00000007737a2a38,0x0000000774080000)
to space 21504K, 0% used [0x0000000774080000,0x0000000774080000,0x0000000775580000)
ParOldGen total 349696K, used 88K [0x00000006c0000000, 0x00000006d5580000, 0x000000076ab00000)
object space 349696K, 0% used [0x00000006c0000000,0x00000006c0016010,0x00000006d5580000)
Metaspace used 18920K, capacity 19414K, committed 19712K, reserved 1067008K
class space used 2312K, capacity 2433K, committed 2560K, reserved 1048576K
Here's one test https://github.com/pitchpoint-solutions/sfs/blob/master/sfs-server/src/test/java/org/sfs/integration/java/test/farm/ReplicatedWriteTest.java.
The test creates a file and opens it in the test context. The test then passes the asycfile instance on line 125 to be consumed by a replica group which internally uses http client requests to write to nodes in the group.
your test seems to miss an await to be correct:
@Test
public void testClientVerticlePumpsToServerVerticle() throws IOException, NoSuchAlgorithmException {
...
await();
}
also it does not use correct Vert.x, the verticle internal state should not be used by other thread (i.e the HttpClient).
While I reckon there are deadlocks, if your test were correctly written those would not appear.
with the proper await your test does not seem to deadlock to me.
Thank you for the response @vietj . Which line should contain the async.await() ? I'm making use of async.complete(). If I use await at the last line of the test the test never finishes because it's blocked on the await condition.
I updated the test to make use of 3 options. One option dead locks and two options don't. If eagerClientConnection is true on the TestVerticle the httpclient connection gets bound to the TestVerticle context, if it's false it gets bound to the test context. With the test I'm attempting to demonstrate a case where the http client connection can be bound to the incorrect context. I suppose if it was consistently bound to the TestVerticle context the test would consistently deadlock in which case the correct way to run a test like this would be to execute the test on the context of the TestVerticle (testNoDeadLockOption2) and perhaps vertx should eagerly fail testNoDeadLockOption1. Thoughts?
@RunWith(VertxUnitRunner.class)
public class Reproducer {
@Rule
public RunTestOnContext runTestOnContext = new RunTestOnContext();
@Test
public void testDeadLock(TestContext testContext) throws IOException, NoSuchAlgorithmException {
final byte[] data = new byte[256];
SecureRandom.getInstanceStrong().nextBytes(data);
int dataSize = 256 * 1024 * 1024;
final Path tempFile = Files.createTempFile("", "");
int bytesWritten = 0;
try (OutputStream out = Files.newOutputStream(tempFile)) {
while (bytesWritten < dataSize) {
out.write(data);
bytesWritten += data.length;
}
}
Async async = testContext.async();
Vertx vertx = runTestOnContext.vertx();
TestVerticle testVerticle = new TestVerticle(true);
OpenOptions openOptions = new OpenOptions();
openOptions.setRead(true);
AsyncFile asyncFile = vertx.fileSystem().openBlocking(tempFile.toString(), openOptions);
vertx.deployVerticle(testVerticle, deploymentResult -> {
if (deploymentResult.failed()) {
testContext.fail(deploymentResult.cause());
}
try {
HttpClient httpClient = testVerticle.getHttpClient();
HttpClientRequest httpClientRequest = httpClient.post("/", httpClientResponse -> {
testContext.assertEquals(200, httpClientResponse.statusCode());
async.complete();
}).exceptionHandler(testContext::fail)
.putHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dataSize))
.setTimeout(10000);
asyncFile.endHandler(aVoid -> httpClientRequest.end());
asyncFile.exceptionHandler(testContext::fail);
Pump pump = Pump.pump(asyncFile, httpClientRequest);
pump.start();
} catch (Throwable e) {
testContext.fail(e);
}
});
}
@Test
public void testNoDeadLockOption1(TestContext testContext) throws IOException, NoSuchAlgorithmException {
final byte[] data = new byte[256];
SecureRandom.getInstanceStrong().nextBytes(data);
int dataSize = 256 * 1024 * 1024;
final Path tempFile = Files.createTempFile("", "");
int bytesWritten = 0;
try (OutputStream out = Files.newOutputStream(tempFile)) {
while (bytesWritten < dataSize) {
out.write(data);
bytesWritten += data.length;
}
}
Async async = testContext.async();
Vertx vertx = runTestOnContext.vertx();
TestVerticle testVerticle = new TestVerticle(false);
OpenOptions openOptions = new OpenOptions();
openOptions.setRead(true);
AsyncFile asyncFile = vertx.fileSystem().openBlocking(tempFile.toString(), openOptions);
vertx.deployVerticle(testVerticle, deploymentResult -> {
if (deploymentResult.failed()) {
testContext.fail(deploymentResult.cause());
}
try {
HttpClient httpClient = testVerticle.getHttpClient();
HttpClientRequest httpClientRequest = httpClient.post("/", httpClientResponse -> {
testContext.assertEquals(200, httpClientResponse.statusCode());
async.complete();
}).exceptionHandler(testContext::fail)
.putHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dataSize))
.setTimeout(10000);
asyncFile.endHandler(aVoid -> httpClientRequest.end());
asyncFile.exceptionHandler(testContext::fail);
Pump pump = Pump.pump(asyncFile, httpClientRequest);
pump.start();
} catch (Throwable e) {
testContext.fail(e);
}
});
}
@Test
public void testNoDeadLockOption2(TestContext testContext) throws IOException, NoSuchAlgorithmException {
final byte[] data = new byte[256];
SecureRandom.getInstanceStrong().nextBytes(data);
int dataSize = 256 * 1024 * 1024;
final Path tempFile = Files.createTempFile("", "");
int bytesWritten = 0;
try (OutputStream out = Files.newOutputStream(tempFile)) {
while (bytesWritten < dataSize) {
out.write(data);
bytesWritten += data.length;
}
}
Async async = testContext.async();
Vertx vertx = runTestOnContext.vertx();
TestVerticle testVerticle = new TestVerticle(true);
vertx.deployVerticle(testVerticle, deploymentResult -> {
if (deploymentResult.failed()) {
testContext.fail(deploymentResult.cause());
}
try {
HttpClient httpClient = testVerticle.getHttpClient();
HttpClientRequest httpClientRequest = httpClient.post("/", httpClientResponse -> {
testContext.assertEquals(200, httpClientResponse.statusCode());
async.complete();
}).exceptionHandler(testContext::fail)
.putHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dataSize))
.setTimeout(10000);
testVerticle.getContext().runOnContext(event -> {
OpenOptions openOptions = new OpenOptions();
openOptions.setRead(true);
AsyncFile asyncFile = vertx.fileSystem().openBlocking(tempFile.toString(), openOptions);
asyncFile.endHandler(aVoid -> httpClientRequest.end());
asyncFile.exceptionHandler(testContext::fail);
Pump pump = Pump.pump(asyncFile, httpClientRequest);
pump.start();
});
} catch (Throwable e) {
testContext.fail(e);
}
});
}
public static class TestVerticle extends AbstractVerticle {
private boolean eagerClientConnection;
private HttpClient httpClient;
public TestVerticle(boolean eagerClientConnection) {
this.eagerClientConnection = eagerClientConnection;
}
@Override
public void start(Future<Void> startFuture) {
HttpServerOptions httpServerOptions = new HttpServerOptions();
HttpServer httpServer = getVertx().createHttpServer(httpServerOptions).requestHandler(httpServerRequest -> {
System.out.println("Server Received Request");
httpServerRequest.pause();
httpServerRequest.endHandler(event -> {
System.out.println("Server Ended Request");
httpServerRequest.response()
.setStatusCode(HttpURLConnection.HTTP_OK)
.end();
});
Pump pump = Pump.pump(httpServerRequest, new NullWriteStream());
pump.start();
httpServerRequest.resume();
});
httpServer.listen(9999, "127.0.0.1", listenResult -> {
if (listenResult.failed()) {
startFuture.fail(listenResult.cause());
} else {
System.out.println("Server is listening on 127.0.0.1:9999");
HttpClientOptions httpClientOptions = new HttpClientOptions();
httpClientOptions.setDefaultHost("127.0.0.1");
httpClientOptions.setDefaultPort(9999);
httpClient = getVertx().createHttpClient(httpClientOptions);
if (eagerClientConnection) {
httpClient.post("/", httpClientResponse -> {
System.out.println("Quick ping to associate connection to this context. If this is not done then no deadlock happens");
startFuture.complete();
}).setTimeout(20000)
.exceptionHandler(startFuture::fail)
.end();
} else {
startFuture.complete();
}
}
});
}
public HttpClient getHttpClient() {
return httpClient;
}
public Context getContext() {
return context;
}
}
public static class NullWriteStream implements WriteStream<Buffer> {
private boolean dirty = false;
private boolean ended = false;
private Handler<Void> drainHandler;
private Handler<Void> endHandler;
public NullWriteStream() {
}
@Override
public NullWriteStream write(Buffer data) {
dirty = true;
handleDrain();
return this;
}
@Override
public NullWriteStream exceptionHandler(Handler<Throwable> handler) {
return this;
}
@Override
public NullWriteStream setWriteQueueMaxSize(int maxSize) {
return this;
}
@Override
public boolean writeQueueFull() {
return false;
}
@Override
public NullWriteStream drainHandler(Handler<Void> handler) {
this.drainHandler = handler;
handleDrain();
return this;
}
@Override
public void end(Buffer buffer) {
ended = true;
handleEnd();
}
@Override
public void end() {
ended = true;
handleEnd();
}
protected void handleDrain() {
if (dirty) {
dirty = false;
Handler<Void> handler = drainHandler;
if (handler != null) {
drainHandler = null;
handler.handle(null);
}
}
}
protected void handleEnd() {
if (ended) {
Handler<Void> handler = endHandler;
if (handler != null) {
endHandler = null;
handler.handle(null);
}
}
}
}
}
the last line
look at most Vert.x Core tests and see how they are build.
for such test you should rather use Vert.x Unit or the upcoming Vert.x JUnit 5 (in 3.5.1) rather than internal vertx core testbed
Thank you @vietj . Are VertxUnitRunner and TestContext not part of Vert.x Unit?
VertxUnitRunner and TestContext are part of Vert.x Unit
I am using them (in sfs and the reproducer above). Are you saying I shouldn't be using them?
unless you can reproduce it with vertx 3.5.1 or later, I will close this issue