Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ryuk startup timeout is too low #621

Closed
zbstof opened this issue Mar 23, 2018 · 2 comments
Closed

Ryuk startup timeout is too low #621

zbstof opened this issue Mar 23, 2018 · 2 comments

Comments

@zbstof
Copy link
Contributor

zbstof commented Mar 23, 2018

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.

@bsideup
Copy link
Member

bsideup commented 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.

@bsideup bsideup added this to the next milestone Mar 25, 2018
bsideup added a commit that referenced this issue Apr 7, 2018
* #621 increase Ryuk's timeout and make it configurable

* Add to CHANGELOG.md
@bsideup
Copy link
Member

bsideup commented Apr 7, 2018

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
Projects
None yet
Development

No branches or pull requests

2 participants