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

Download stuck #37

Closed
ghost opened this issue Jul 26, 2020 · 11 comments
Closed

Download stuck #37

ghost opened this issue Jul 26, 2020 · 11 comments

Comments

@ghost
Copy link

ghost commented Jul 26, 2020

I noticed some of other users sometimes getting stuck while downloading, this happened also with me any time.
When it getting stuck Pump.stop() not functioning, and need to wait for a while, maybe when setRetry task done

https://gofile.io/d/M0bg1X

from me
image

other user
image

W/System.err: java.net.SocketTimeoutException: Read timed out
W/System.err:     at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
        at com.android.org.conscrypt.NativeSsl.read(NativeSsl.java:411)
        at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:549)
W/System.err:     at okio.InputStreamSource.read(JvmOkio.kt:90)
        at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)
        at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:449)
        at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:333)
        at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)
        at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)
        at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at com.huxq17.download.core.connection.OkHttpDownloadConnection.connect(OkHttpDownloadConnection.java:44)
        at com.huxq17.download.core.interceptor.ConnectInterceptor.connect(ConnectInterceptor.java:243)
        at com.huxq17.download.core.interceptor.ConnectInterceptor.intercept(ConnectInterceptor.java:72)
W/System.err:     at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
        at com.huxq17.download.core.interceptor.RetryInterceptor.intercept(RetryInterceptor.java:26)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
W/System.err:     at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:31)
        at com.huxq17.download.core.task.DownloadTask.downloadWithDownloadChain(DownloadTask.java:99)
        at com.huxq17.download.core.task.DownloadTask.execute(DownloadTask.java:85)
        at com.huxq17.download.core.task.Task.run(Task.java:23)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
V/FA: Inactivity, disconnecting from the service
W/System.err: java.net.SocketTimeoutException: timeout
W/System.err:     at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)
        at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)
        at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:340)
W/System.err:     at okio.RealBufferedSource.read(RealBufferedSource.kt:188)
        at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.kt:331)
        at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.kt:368)
        at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276)
        at okio.RealBufferedSource.read(RealBufferedSource.kt:267)
        at com.huxq17.download.core.connection.OkHttpDownloadConnection.downloadBuffer(OkHttpDownloadConnection.java:62)
W/System.err:     at com.huxq17.download.core.task.DownloadBlockTask.download(DownloadBlockTask.java:138)
        at com.huxq17.download.core.task.DownloadBlockTask.execute(DownloadBlockTask.java:99)
        at com.huxq17.download.core.task.Task.run(Task.java:23)
        at com.huxq17.download.core.interceptor.ConnectInterceptor.intercept(ConnectInterceptor.java:148)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
        at com.huxq17.download.core.interceptor.RetryInterceptor.intercept(RetryInterceptor.java:26)
W/System.err:     at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:31)
        at com.huxq17.download.core.task.DownloadTask.downloadWithDownloadChain(DownloadTask.java:99)
        at com.huxq17.download.core.task.DownloadTask.execute(DownloadTask.java:85)
        at com.huxq17.download.core.task.Task.run(Task.java:23)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
    Caused by: java.net.SocketException: socket is closed
W/System.err:     at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:554)
        at okio.InputStreamSource.read(JvmOkio.kt:90)
        at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)
    	... 20 more
W/System.err: java.net.SocketTimeoutException: timeout
W/System.err:     at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)
W/System.err:     at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)
        at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:340)
        at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:449)
W/System.err:     at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:333)
        at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)
        at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)
W/System.err:     at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at com.huxq17.download.core.connection.OkHttpDownloadConnection.connect(OkHttpDownloadConnection.java:44)
W/System.err:     at com.huxq17.download.core.interceptor.ConnectInterceptor.connect(ConnectInterceptor.java:243)
        at com.huxq17.download.core.interceptor.ConnectInterceptor.intercept(ConnectInterceptor.java:72)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
W/System.err:     at com.huxq17.download.core.interceptor.RetryInterceptor.intercept(RetryInterceptor.java:26)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:31)
        at com.huxq17.download.core.task.DownloadTask.downloadWithDownloadChain(DownloadTask.java:99)
W/System.err:     at com.huxq17.download.core.task.DownloadTask.execute(DownloadTask.java:85)
W/System.err:     at com.huxq17.download.core.task.Task.run(Task.java:23)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err:     at java.lang.Thread.run(Thread.java:919)
W/System.err: Caused by: java.net.SocketException: socket is closed
        at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:554)
        at okio.InputStreamSource.read(JvmOkio.kt:90)
W/System.err:     at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)
    	... 30 more
W/System.err: java.net.SocketTimeoutException: timeout
W/System.err:     at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)
        at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)
W/System.err:     at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:340)
        at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:449)
        at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:333)
        at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)
W/System.err:     at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)
        at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
W/System.err:     at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
W/System.err:     at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at com.huxq17.download.core.connection.OkHttpDownloadConnection.connect(OkHttpDownloadConnection.java:44)
        at com.huxq17.download.core.interceptor.ConnectInterceptor.connect(ConnectInterceptor.java:243)
W/System.err:     at com.huxq17.download.core.interceptor.ConnectInterceptor.intercept(ConnectInterceptor.java:72)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
        at com.huxq17.download.core.interceptor.RetryInterceptor.intercept(RetryInterceptor.java:26)
        at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:43)
W/System.err:     at com.huxq17.download.core.RealDownloadChain.proceed(RealDownloadChain.java:31)
        at com.huxq17.download.core.task.DownloadTask.downloadWithDownloadChain(DownloadTask.java:99)
        at com.huxq17.download.core.task.DownloadTask.execute(DownloadTask.java:85)
W/System.err:     at com.huxq17.download.core.task.Task.run(Task.java:23)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
W/System.err: Caused by: java.net.SocketTimeoutException: Read timed out
        at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
W/System.err:     at com.android.org.conscrypt.NativeSsl.read(NativeSsl.java:411)
        at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:549)
        at okio.InputStreamSource.read(JvmOkio.kt:90)
W/System.err:     at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)
    	... 30 more
@huxq17
Copy link
Owner

huxq17 commented Jul 27, 2020

what do you want? setRetry maybe a functional way, Pump.stop() can not interrupt download while network is stuck.

@ghost
Copy link
Author

ghost commented Jul 27, 2020

Some of my users report me that they don't have any issue with download while using chrome, other browsers, or maybe download manager.
I'm sorry about this, I have tried several download manager libs in GitHub with OkHttp as network manager still facing the same issue, also increase the timeout didn't help

@huxq17
Copy link
Owner

huxq17 commented Jul 27, 2020

It looks like Okhttp's bug.

@huxq17
Copy link
Owner

huxq17 commented Jul 27, 2020

But system's download manager using HttpUrlConnection, it's implemetation is Okhttp .

@ghost
Copy link
Author

ghost commented Jul 27, 2020

Okhttp download failed at 20%

Httpurlconnection still continue until done

@ghost
Copy link
Author

ghost commented Jul 27, 2020

This also happened with dood.to and ddl.to or maybe with other some file hosting. Download always failed at start but with HttpUrlConnection I can download without problem

@huxq17
Copy link
Owner

huxq17 commented Jul 28, 2020

I will test later.

@huxq17
Copy link
Owner

huxq17 commented Jul 29, 2020

Have you download with multi thread? android system downloader is download with single thread.

@ghost
Copy link
Author

ghost commented Jul 29, 2020

It works by set the thread to 1, but for download failed at start it doesn't.

Can you test dood.to?

@huxq17
Copy link
Owner

huxq17 commented Jul 29, 2020

It works by set the thread to 1, but for download failed at start it doesn't.

Can you test dood.to?

timeout is fixed by set thread num to 1?what is dowload failed at start?

@ghost
Copy link
Author

ghost commented Jul 29, 2020

I set threadNum to 1
Screenshot_20200730-061924782.jpg

It is fixed now, thank you

@ghost ghost closed this as completed Jul 30, 2020
This issue was closed.
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

No branches or pull requests

1 participant