Skip to content

Ryuk startup timeout is too low #621

Closed

Description

@zbstof

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:

If this is resolved, I think you can close #581 , which seem related.

Activity

  1. bsideup commented on Mar 23, 2018

    @bsideup
    Member

    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.

  2. added this to the next milestone on Mar 25, 2018
  3. added a commit that references this issue on Apr 6, 2018
  4. added a commit that references this issue on Apr 7, 2018
  5. bsideup commented on Apr 7, 2018

    @bsideup
    Member

    Released in 1.7.0 (already in Bintray's JCenter, will be synced with Maven Central soon)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions