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

Fix for streaming readBytes timeout on Windows with npipe strat… #1947

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

rnorth
Copy link
Member

@rnorth rnorth commented Oct 4, 2019

It seems that #1886 needs some work in NamedPipeSocketFactory.


Gradle Test Executor 1 > org.testcontainers.dockerclient.EventStreamTest > test STARTED

Gradle Test Executor 1 > org.testcontainers.dockerclient.EventStreamTest > test FAILED
    org.junit.runners.model.TestTimedOutException: test timed out after 10 seconds
        at java.base@11.0.3/java.io.RandomAccessFile.readBytes(Native Method)
        at java.base@11.0.3/java.io.RandomAccessFile.read(RandomAccessFile.java:406)
        at app//org.testcontainers.dockerclient.transport.okhttp.NamedPipeSocketFactory$1$1.read(NamedPipeSocketFactory.java:58)
        at app//okio.Okio$2.read(Okio.java:140)
        at app//okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
        at app//okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
        at app//okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
        at app//okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:224)
        at app//okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.readChunkSize(Http1ExchangeCodec.java:489)
        at app//okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:471)
        at app//okhttp3.internal.Util.skipAll(Util.java:204)
        at app//okhttp3.internal.Util.discard(Util.java:186)
        at app//okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.close(Http1ExchangeCodec.java:511)
        at app//okio.ForwardingSource.close(ForwardingSource.java:43)
        at app//okhttp3.internal.connection.Exchange$ResponseBodySource.close(Exchange.java:313)
        at app//okio.RealBufferedSource.close(RealBufferedSource.java:476)
        at app//okhttp3.internal.Util.closeQuietly(Util.java:139)
        at app//okhttp3.ResponseBody.close(ResponseBody.java:192)
        at app//okhttp3.Response.close(Response.java:290)
        at app//org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.lambda$executeAndStream$2(OkHttpInvocationBuilder.java:308)
        at app//org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder$$Lambda$124/0x00000008002f1040.close(Unknown Source)
        at app//com.github.dockerjava.core.async.ResultCallbackTemplate.close(ResultCallbackTemplate.java:79)
        at app//org.testcontainers.dockerclient.EventStreamTest.test(EventStreamTest.java:60)

I think we need to mirror the new behaviour of UnixSocketFactory to avoid a blocking file read. Trying this.

@rnorth
Copy link
Member Author

rnorth commented Oct 4, 2019

/AzurePipelines run Windows 10 - Docker for Windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a miss from my end! Thanks a lot for spotting it 💯👏

@rnorth rnorth marked this pull request as ready for review October 4, 2019 13:47
@rnorth rnorth requested a review from kiview as a code owner October 4, 2019 13:47
@rnorth
Copy link
Member Author

rnorth commented Oct 4, 2019

Looks like this is the fix; have verified on CI and a local Win 10 machine.

@rnorth rnorth changed the title Tentative fix for readBytes timeout on Windows Fix for streaming readBytes timeout on Windows with npipe strategy Oct 4, 2019
@rnorth rnorth changed the title Fix for streaming readBytes timeout on Windows with npipe strategy Fix for streaming readBytes timeout on Windows with npipe strat… Oct 4, 2019
@rnorth rnorth merged commit bc082a8 into master Oct 4, 2019
@rnorth rnorth deleted the fix-windows-stream-timeout branch October 4, 2019 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants