Repository navigation
Closed
Milestone
Description
On our slow Jenkins Ryuk doesn't start consistently in 5 seconds hardcoded in ResourceReaper#start:
// We need to wait before we can start any containers to make sure that we delete them
if (!ryukScheduledLatch.await(5, TimeUnit.SECONDS)) {
throw new IllegalStateException("Can not connect to Ryuk");
}
Which leads to the following stacktraces:
WARN # org.testcontainers.utility.ResourceReaper.lambda$start$2 Can not connect to Ryuk at localhost:35047
java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_152]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ~[?:1.8.0_152]
at java.net.SocketOutputStream.write(SocketOutputStream.java:134) ~[?:1.8.0_152]
at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:136) ~[testcontainers-1.6.0.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]
WARN # org.testcontainers.utility.ResourceReaper.lambda$start$2 Can not connect to Ryuk at localhost:35047
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:1.8.0_152]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_152]
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[?:1.8.0_152]
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[?:1.8.0_152]
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[?:1.8.0_152]
at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[?:1.8.0_152]
at java.io.BufferedReader.fill(BufferedReader.java:161) ~[?:1.8.0_152]
at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[?:1.8.0_152]
at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[?:1.8.0_152]
at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:139) ~[testcontainers-1.6.0.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]
[...]
Caused by: java.lang.IllegalStateException: Can not connect to Ryuk
at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:158) ~[testcontainers-1.6.0.jar:?]
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:116) ~[testcontainers-1.6.0.jar:?]
at org.testcontainers.containers.GenericContainer.<init>(GenericContainer.java:126) ~[testcontainers-1.6.0.jar:?]
To solve this, 2 things could be done:
- Increase timeout to more than 10 seconds (or even 1 minute, as the case in )
testcontainers-java/core/src/main/java/org/testcontainers/containers/GenericContainer.java
Line 274 in 8558203
resultCallback.getCompletionLatch().await(1, TimeUnit.MINUTES); - Make timeout configurable
If this is resolved, I think you can close #581 , which seem related.
Reacted by David Matějček
Activity
bsideup commentedon Mar 23, 2018
Hi @zbstof!
Thanks for reporting. Now, on a second thought, I do think that the timeout is super low and must be increased!
However, I think #581 is something else we need to investigate.
#621 increase Ryuk's timeout and make it configurable
#621 increase Ryuk's timeout and make it configurable (#635)
bsideup commentedon Apr 7, 2018
Released in 1.7.0 (already in Bintray's JCenter, will be synced with Maven Central soon)