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

下载文件中断并失败(附日志) #763

Closed
serious198706 opened this issue Sep 14, 2017 · 9 comments
Closed

下载文件中断并失败(附日志) #763

serious198706 opened this issue Sep 14, 2017 · 9 comments
Milestone

Comments

@serious198706
Copy link

serious198706 commented Sep 14, 2017

文件大小300MB左右;文件存放在七牛,并且开启了防盗链,所以使用filedownloader-okhttp3-connection:1.0.0来进行header的自定义;okhttp版本为3.9.0;FileDownloader版本为1.6.5。

问题在于下载时会自动中断,并且下载失败,而且几乎每次下载必定发生。日志如下(只截取了出问题的部分,出问题之前都是重复的日志):

09-14 15:41:45.795 13210-14029/com.zhtd.vr.goddess D/FileDownloader.FileDownloadMessenger: notify progress 1026369139@com.liulishuo.filedownloader.DownloadTask@b4f4bdd 21985778 199170455
09-14 15:41:46.457 13927-13986/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[2] offset[89212645], consume[18]
09-14 15:41:47.142 13927-13985/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[1] offset[46382301], consume[20]
09-14 15:41:47.744 13927-13988/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[4] offset[161376890], consume[25]
09-14 15:41:48.470 13927-13986/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[2] offset[89998177], consume[25]
09-14 15:41:48.848 13210-14029/com.zhtd.vr.goddess D/FileDownloader.MessageSnapshotGate: ~~~callback 1026369139 old[3] new[3] 1
09-14 15:41:48.854 13210-14029/com.zhtd.vr.goddess D/FileDownloader.FileDownloadMessenger: notify progress 1026369139@com.liulishuo.filedownloader.DownloadTask@b4f4bdd 23968278 199170455
09-14 15:41:48.860 13210-14029/com.zhtd.vr.goddess D/FileDownloader.MessageSnapshotGate: ~~~callback 1026369139 old[3] new[3] 1
09-14 15:41:48.866 13210-14029/com.zhtd.vr.goddess D/FileDownloader.FileDownloadMessenger: notify progress 1026369139@com.liulishuo.filedownloader.DownloadTask@b4f4bdd 23968278 199170455
09-14 15:41:49.261 13927-13984/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[0] offset[2188642], consume[20]
09-14 15:41:49.316 13927-13985/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[1] offset[46649469], consume[14]
09-14 15:41:49.357 13210-14029/com.zhtd.vr.goddess D/FileDownloader.MessageSnapshotGate: ~~~callback 1026369139 old[3] new[-1] 1
09-14 15:41:49.358 13210-14029/com.zhtd.vr.goddess V/FileDownloader.FileDownloadList: remove 1026369139@com.liulishuo.filedownloader.DownloadTask@b4f4bdd left -1 0
09-14 15:41:49.359 13210-14029/com.zhtd.vr.goddess D/FileDownloader.FileDownloadMessenger: notify error 1026369139@com.liulishuo.filedownloader.DownloadTask@b4f4bdd java.net.SocketTimeoutException: timeout
09-14 15:41:49.359 13210-14029/com.zhtd.vr.goddess V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@3ced352 by -1 
09-14 15:41:49.370 13927-13986/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[2] offset[90359205], consume[5]
09-14 15:41:49.424 13927-13985/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[1] offset[46649469], consume[5]
09-14 15:41:51.710 13927-13988/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[4] offset[161465462], consume[21]
09-14 15:41:51.816 13927-13988/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[4] offset[161465462], consume[3]
09-14 15:41:57.416 13927-13987/com.zhtd.vr.goddess:filedownloader D/FileDownloader.FetchDataTask: require sync id[1026369139] index[3] offset[121930482], consume[12]
09-14 15:41:57.419 13927-13987/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadStatusCallback: require callback -1 but the host thread of the flow has already dead, what is occurred because of there are several reason can final this flow on different thread.
09-14 15:41:57.422 13927-13975/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [1026369139] TRUE FALSE
09-14 15:41:57.424 13927-13975/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [1026369139] TRUE FALSE
09-14 15:41:57.426 13927-13975/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [1026369139] TRUE FALSE
09-14 15:41:57.428 13927-13975/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [1026369139] TRUE FALSE
09-14 15:41:57.431 13927-13975/com.zhtd.vr.goddess:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [1026369139] TRUE FALSE

可以看到有个java.net.SocketTimeoutException。所以我在初始化filedownloader-okhttp3-connection时,自定义了timeout的时间为30秒。

builder.connectTimeout(30_000, TimeUnit.MILLISECONDS);

但是依旧会出问题。

这是只过滤了FileDownloader的日志,如果有需要其他的日志,我再提取。烦请关注一下,多谢。

@BigExcalibur
Copy link

跟你一样,一直也是这个问题,timeout后必定会重新下载

@Jacksgong
Copy link
Collaborator

@serious198706 @BigExcalibur

SocketTimeoutException

  • 该异常有可能发生在读写超时,而非连接超时。
  • 并且该问题并非FileDownloader本身的问题,是网络不稳定,甚至是某台CDN不稳定、或传输过程中任意一台交换机、路由器不稳定造成。

该问题不是不启动断点续传的原因

这个问题我在每一个issue中都强调了很多次,上一次的下载失败并不是下一次是否断点续传的原因,因为在下载停止(无论是用户主动触发暂停,还是出现错误,都只会记录当前下载到哪里,以及停止原因),而下一启动的时候,都只会取出上次下载到哪里的数据,不会在乎上一次停止的原因(这个原因数据是给用户层使用的),而FileDownloader会尽可能的保证断点续传。

是否能够断点续传的决定因素

客户端与后台共同决定的

  • 在绝大多数场景下是后台不允许该资源的断点续传,如返回状态码不支持获取局部获取数据
  • 而客户端决定不断点续传的情况是为了保证文件的完整性有效性的抉择,是 比如: 文件被在尝试断点续传时发现被修改过;上次是分块下载,但是本次用户层提供了一个不支持seek的输出流;

这是一个开源项目,还请大家共同维护

源码都在,我只能提供尽量多的信息协作各位解决问题,当出现问题的时候,你们是第一现场,可以通过搜索wiki、issue、readme,开启日志,排查问题,甚至是直接DEBUG(请从DownloadLaunchRunnable#run开始DEBUG),直接找到不进行断点续传的原因,如果找到该原因还有不解,此时提出ISSUE,我进一步协助你,如果可以解决,直接提交PR,这才是一个开源库正确的打开姿势,也极大的提高了问题的解决效率。

ONE MORE THING

通常在分块下载的时候,由于对同一个host同时发起多个相同的请求,有可能有些后台出于BUG或者是保护,返回了非局部获取的状态码,导致本地无法通过断点续传下载,这种情况也存在。

@BigExcalibur
Copy link

BigExcalibur commented Sep 15, 2017

@Jacksgong
大佬你好,非常感谢你为开源做出的贡献。开源项目应该大家一起维护,这个我非常同意。这几天我一直在尝试找出问题,分析日志,尝试pr,无奈项目复杂程度超乎想象,可惜我功力不够,一直没有找出问题,希望大佬能提供一些思路。
DownloadLaunchRunnable#run 这一块的日志我也提供了,在上一个issue里

最开始我使用的是公司后台,发现了问题,后来测试时,我采用的是应用宝的后台,url如下
http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk

这是一个350M左右的文件,仍然出现了下载到一部分后因为网络原因重新下载的问题。说明应该不大可能是后台问题。我采用的是Demo里面的单任务测试,修改了url,进行测试的。
你提到的WIFI不稳定问题,这个我比较同意,因为我测试的环境就是网络比较恶劣的情况。

09-13 17:53:27.191 27159-28602/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 461854951@com.liulishuo.filedownloader.DownloadTask@543fca1 java.net.SocketTimeoutException
09-13 17:53:27.191 27159-28602/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@3a71cec6 by -1 
09-13 17:53:27.420 28019-28609/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:27.421 28019-28609/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[4] offset[283945752], consume[13]
09-13 17:53:27.549 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 19. Thread differ : -1. unknown: -1 [(-)source-status-callback]
09-13 17:53:27.550 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 19. Thread differ : -1. unknown: -1 [(-)source-status-callback]
09-13 17:53:27.551 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 19. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 14
09-13 17:53:27.559 28019-28609/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:27.559 28019-28609/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[4] offset[283945752], consume[18]
09-13 17:53:27.645 28019-28608/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:27.646 28019-28608/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[3] offset[213721679], consume[11]
09-13 17:53:27.823 28019-28608/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:27.823 28019-28608/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[3] offset[213721679], consume[12]
09-13 17:53:30.283 28019-28607/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:30.283 28019-28607/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[2] offset[141294818], consume[17]
09-13 17:53:30.398 28019-28607/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:30.398 28019-28607/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[2] offset[141294818], consume[17]
09-13 17:53:33.348 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1 [(-)FileDownloader-Flow-02]
09-13 17:53:33.349 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1
09-13 17:53:33.349 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. Binder: 3 | unknown: 13
09-13 17:53:33.572 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 15. Thread differ : -4. FlowSingle: -1 [(-)FileDownloader-Flow-02] | unknown: -3 [(-)FileDownloader-download-executor2, (-)FileDownloader-download-executor4, (-)FileDownloader-download-executor5]
09-13 17:53:33.573 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 15. Thread differ : -4. FlowSingle: -1 | unknown: -3 [(-)FileDownloader-download-executor2, (-)FileDownloader-download-executor4, (-)FileDownloader-download-executor5]
09-13 17:53:33.573 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 15. OkHttp: 1 | Binder: 2 | Network: 1 | unknown: 11
09-13 17:53:35.578 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 14. Thread differ : -1. unknown: -1 [(-)FileDownloader-download-executor3]
09-13 17:53:35.579 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 14. Thread differ : -1. unknown: -1 [(-)FileDownloader-download-executor3]
09-13 17:53:35.580 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 14. OkHttp: 1 | Binder: 2 | Network: 1 | unknown: 10
09-13 17:53:38.296 28019-28605/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:38.297 28019-28605/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[0] offset[488560], consume[17]
09-13 17:53:38.299 28019-28079/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE
09-13 17:53:38.299 28019-28079/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE
09-13 17:53:38.300 28019-28079/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE
09-13 17:53:38.300 28019-28079/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE
09-13 17:53:38.301 28019-28079/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE
09-13 17:53:43.233 27159-27159/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setListener com.liulishuo.filedownloader.demo.HybridTestActivity$3@2876a0b2
09-13 17:53:43.234 27159-27159/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setTag 1
09-13 17:53:43.234 27159-27159/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: call start Url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], Path[null] Listener[com.liulishuo.filedownloader.demo.HybridTestActivity$3@2876a0b2], Tag[1]
09-13 17:53:43.270 27159-27159/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setPath /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e
09-13 17:53:43.271 27159-27159/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTaskHunter: save Path is null to /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e
09-13 17:53:43.273 27159-27159/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: the task[461854951] has been into the launch pool.
09-13 17:53:43.282 27159-30013/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify begin 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.282 27159-30013/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@17d07db9 by 11 
09-13 17:53:43.282 27159-30013/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadList: add list in all 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380 11 1
09-13 17:53:43.286 28019-28036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: request start the task with url(http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk) path(/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e) isDirectory(FALSE)
09-13 17:53:43.287 28019-28036/com.liulishuo.filedownloader.demo:filedownloader E/FileDownloader.FileDownloadManager: 461854951 status is[3](not finish) & but not in the pool
09-13 17:53:43.326 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: test_ isMultiConnection = false supportSeek = true  model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[6], sofar[0], total[0], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@238e57a8connectionCount = 1
09-13 17:53:43.327 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[11] new[1] 1
09-13 17:53:43.327 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 461854951 the downloaded-record is zero.
09-13 17:53:43.328 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:    isBreakpointAvailable false
09-13 17:53:43.329 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify pending 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.329 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 461854951 the downloaded-record is zero.
09-13 17:53:43.329 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[1] new[6] 1
09-13 17:53:43.330 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify started 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.330 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isResumeAvailableOnDB = false
09-13 17:53:43.354 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=0-]}
09-13 17:53:43.381 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 18. Thread differ : +2. FlowSingle: +1 [(+)FileDownloader-Flow-03] | LauncherTask: +1 [(+)FileDownloader-LauncherTask3]
09-13 17:53:43.382 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 18. Thread differ : +2. FlowSingle: +1 | LauncherTask: +1
09-13 17:53:43.382 27159-27209/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 18. Binder: 3 | FlowSingle: 1 | LauncherTask: 1 | unknown: 13
09-13 17:53:43.473 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: etag find null for task(461854951)
09-13 17:53:43.544 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  -----------checkupBeforeFetch------------
09-13 17:53:43.545 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[6] new[2] 1
09-13 17:53:43.546 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify connected 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.556 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isMultiConnectionAvailable() = true
09-13 17:53:43.557 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isResumeAvailableOnDB = false
09-13 17:53:43.611 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 15. Thread differ : +1. Network: SWAP [(+)FileDownloader-Network2, (-)FileDownloader-Network1] | FlowSingle: +1 [(+)FileDownloader-Flow-03] | unknown: SWAP [(+)source-status-callback, (-)FileDownloader-download-executor1]
09-13 17:53:43.612 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 15. Thread differ : +1. FlowSingle: +1 | unknown: SWAP [(+)source-status-callback, (-)FileDownloader-download-executor1]
09-13 17:53:43.613 28019-28053/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 15. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 10
09-13 17:53:43.671 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: fetch data with multiple connection(count: [5]) for task[461854951]
09-13 17:53:43.671 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[461854951] index[0] range[0, 70645948) current offset(0)
09-13 17:53:43.672 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[461854951] index[1] range[70645949, 141291897) current offset(70645949)
09-13 17:53:43.673 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[461854951] index[2] range[141291898, 211937846) current offset(141291898)
09-13 17:53:43.674 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[461854951] index[3] range[211937847, 282583795) current offset(211937847)
09-13 17:53:43.674 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[461854951] index[4] range[282583796, 0) current offset(282583796)
09-13 17:53:43.687 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=282583796-]}
09-13 17:53:43.688 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=141291898-211937846]}
09-13 17:53:43.691 28019-30036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=0-70645948]}
09-13 17:53:43.698 28019-30037/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=70645949-141291897]}
09-13 17:53:43.698 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: 461854951 request header {Range=[bytes=211937847-282583795]}
09-13 17:53:43.798 28019-30036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[0] for 461854951, is connected range[0, 70645948) current offset[0] with code[206]
09-13 17:53:43.799 28019-30036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-13 17:53:43.801 28019-30036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(0): range [0, 70645948), seek to[0]
09-13 17:53:43.805 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[2] new[3] 1
09-13 17:53:43.806 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380 1460 353229748
09-13 17:53:43.839 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[4] for 461854951, is connected range[282583796, 0) current offset[282583796] with code[206]
09-13 17:53:43.839 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-13 17:53:43.844 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(4): range [282583796, 0), seek to[282583796]
09-13 17:53:43.872 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:43.873 28019-30040/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[4] offset[282585256], consume[26]
09-13 17:53:43.939 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[2] for 461854951, is connected range[141291898, 211937846) current offset[141291898] with code[206]
09-13 17:53:43.941 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-13 17:53:43.947 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[3] new[3] 1
09-13 17:53:43.948 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380 37676 353229748
09-13 17:53:43.950 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(2): range [141291898, 211937846), seek to[141291898]
09-13 17:53:43.977 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:43.977 28019-30038/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[2] offset[141295994], consume[25]
09-13 17:53:44.058 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[3] for 461854951, is connected range[211937847, 282583795) current offset[211937847] with code[206]
09-13 17:53:44.059 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-13 17:53:44.065 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[3] new[3] 1
09-13 17:53:44.065 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380 74460 353229748
09-13 17:53:44.066 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(3): range [211937847, 282583795), seek to[211937847]
09-13 17:53:44.088 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-13 17:53:44.089 28019-30039/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[3] offset[211941943], consume[20]

@BigExcalibur
Copy link

补充一下日志

直接关闭WIFI,造成网络断开的报错如下

09-15 11:15:14.221 10825-29478/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 1461485034@com.liulishuo.filedownloader.DownloadTask@bd7b4ed java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-15 11:15:14.221 10825-29478/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@20466f22 by -1 
09-15 11:15:14.232 10825-10825/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-15 11:15:14.241 10825-10825/com.liulishuo.filedownloader.demo W/System.err: java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:592)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at libcore.io.IoBridge.recvfrom(IoBridge.java:556)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.Okio$2.read(Okio.java:113)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:48)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:446)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.io.InputStream.read(InputStream.java:162)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:146)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.DownloadRunnable.run(DownloadRunnable.java:113)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.lang.Thread.run(Thread.java:818)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err: Caused by: android.system.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)

下面这个报错则是正常下载中出现异常并重新下载的报错日志。

09-15 11:10:04.568 10825-15214/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 1461485034@com.liulishuo.filedownloader.DownloadTask@1d28c5e4 java.net.SocketTimeoutException
09-15 11:10:04.569 10825-15214/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@8ffea4d by -1 
09-15 11:10:04.580 10825-10825/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err: java.net.SocketTimeoutException
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.Okio$2.read(Okio.java:113)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:48)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:446)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.io.InputStream.read(InputStream.java:162)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:146)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.DownloadRunnable.run(DownloadRunnable.java:113)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.lang.Thread.run(Thread.java:818)

@BigExcalibur
Copy link

任务断开重连后,日志如下。有两个疑问:

  1. 原任务connection总数为5,出现错误后读取的connectionCount为1。
  2. 原任务record被重置为0
09-13 17:53:43.286 28019-28036/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: request start the task with url(http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk) path(/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e) isDirectory(FALSE)
09-13 17:53:43.287 28019-28036/com.liulishuo.filedownloader.demo:filedownloader E/FileDownloader.FileDownloadManager: 461854951 status is[3](not finish) & but not in the pool
09-13 17:53:43.326 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: test_ isMultiConnection = false supportSeek = true  model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[6], sofar[0], total[0], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@238e57a8connectionCount = 1
09-13 17:53:43.327 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[11] new[1] 1
09-13 17:53:43.327 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 461854951 the downloaded-record is zero.
09-13 17:53:43.328 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:    isBreakpointAvailable false
09-13 17:53:43.329 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify pending 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.329 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 461854951 the downloaded-record is zero.
09-13 17:53:43.329 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[1] new[6] 1
09-13 17:53:43.330 27159-30017/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify started 461854951@com.liulishuo.filedownloader.DownloadTask@1dd31380
09-13 17:53:43.330 28019-30015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isResumeAvailableOnDB = false

@BigExcalibur
Copy link

BigExcalibur commented Sep 15, 2017

@serious198706 @Jacksgong

下午找了一下原因,猜测是报错后DefaultDatabaseImpl中的downloaderModelMap的数据维护出现了问题或者出现了错误调用,导致数据丢失,导出db文件后发现数据库中的数据正常。

由于DownloadManager只有每次初始化时才会从数据库中更新数据,因此尝试修改为当内存中无法获取时,则尝试从数据库读取数据。目前可以解决问题,下一步会尝试找到downloaderModelMap中维护的对象被删除的具体原因。

以下是暂时的解决办法,将DefaultDatabaseImpl#find 修改为如下

 @Override
    public FileDownloadModel find(final int id) {
        FileDownloadModel model = downloaderModelMap.get(id);
        if (model != null) {
            return downloaderModelMap.get(id);
        }

        Cursor c = null;
        try {
            c = db.rawQuery(FileDownloadUtils.formatString("SELECT * FROM %s WHERE %s = ?",
                    TABLE_NAME, FileDownloadModel.ID), new String[]{Integer.toString(id)});

            while (c.moveToNext()) {
                model = new FileDownloadModel();
                model.setId(c.getInt(c.getColumnIndex(FileDownloadModel.ID)));
                model.setUrl(c.getString(c.getColumnIndex(FileDownloadModel.URL)));
                model.setPath(c.getString(c.getColumnIndex(FileDownloadModel.PATH)),
                        c.getShort(c.getColumnIndex(FileDownloadModel.PATH_AS_DIRECTORY)) == 1);
                model.setStatus((byte) c.getShort(c.getColumnIndex(FileDownloadModel.STATUS)));
                model.setSoFar(c.getLong(c.getColumnIndex(FileDownloadModel.SOFAR)));
                model.setTotal(c.getLong(c.getColumnIndex(FileDownloadModel.TOTAL)));
                model.setErrMsg(c.getString(c.getColumnIndex(FileDownloadModel.ERR_MSG)));
                model.setETag(c.getString(c.getColumnIndex(FileDownloadModel.ETAG)));
                model.setFilename(c.getString(c.getColumnIndex(FileDownloadModel.FILENAME)));
                model.setConnectionCount(c.getInt(c.getColumnIndex(FileDownloadModel.CONNECTION_COUNT)));

            }
        } finally {
            if (c != null)
                c.close();
        }
        return model;

    }

@Jacksgong
Copy link
Collaborator

Jacksgong commented Sep 15, 2017

@BigExcalibur

can't continue 461854951 the downloaded-record is zero.

这个错误只有可能出现在,上一次下载不是分块分块下载的(connectionCount<=1),并且之前的下载数据为0的情况(currentOffset == 0)。

根据该链路本身默认是分块下载的,如果你没有修改过分块下载这块的逻辑,我怀疑是因为你主动修改了connectionCount导致。


因为在connectionCount > 1的情况下filedownloader表本身是不记录下载进度的,所有的进度数据只记录在分块表filedownloaderConnection中。


ONE MORE THING

我切换到了FileDownloader的master分支,并且在单任务下载中替换了你的连接,而后我反复的关闭wifi测试,没有出现断点续传从0开始的问题(下面是录像Gif,有1.3M,请等待加载):

ezgif com-video-to-gif

@BigExcalibur
Copy link

BigExcalibur commented Sep 18, 2017

@Jacksgong 非常感谢大佬的测试,但是很遗憾,手动触发造成的socket time out的exception并不会造成此类情况发生,因此复现的局限性可能会比较大。

你可以参考我前面的日志。手动断开WIFI和出现重新下载的message是不一样的。前者为手动断开,后者为断点重新下载的error message。

直接关闭WIFI,造成网络断开的报错如下

09-15 11:15:14.221 10825-29478/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 1461485034@com.liulishuo.filedownloader.DownloadTask@bd7b4ed java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-15 11:15:14.221 10825-29478/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@20466f22 by -1 
09-15 11:15:14.232 10825-10825/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-15 11:15:14.241 10825-10825/com.liulishuo.filedownloader.demo W/System.err: java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:592)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at libcore.io.IoBridge.recvfrom(IoBridge.java:556)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.Okio$2.read(Okio.java:113)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:48)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:446)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
09-15 11:15:14.242 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.io.InputStream.read(InputStream.java:162)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:146)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.DownloadRunnable.run(DownloadRunnable.java:113)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.lang.Thread.run(Thread.java:818)
09-15 11:15:14.243 10825-10825/com.liulishuo.filedownloader.demo W/System.err: Caused by: android.system.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)

下面这个报错则是正常下载中出现异常并重新下载的报错日志。

09-15 11:10:04.568 10825-15214/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 1461485034@com.liulishuo.filedownloader.DownloadTask@1d28c5e4 java.net.SocketTimeoutException
09-15 11:10:04.569 10825-15214/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@8ffea4d by -1 
09-15 11:10:04.580 10825-10825/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err: java.net.SocketTimeoutException
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.Okio$2.read(Okio.java:113)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:48)
09-15 11:10:04.596 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:446)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.io.InputStream.read(InputStream.java:162)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:146)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.DownloadRunnable.run(DownloadRunnable.java:113)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at java.lang.Thread.run(Thread.java:818)

下载库在网络良好的情况下并不会发生该类错误,这个我也经过了测试。由于公司网络路由连接比较多,所以网络状况不会特别好,才会出现此类异常。一般是自动断开连接而不是手动断开。

我使用腾讯的应用宝APP,去下载任意的大文件应用,采用公司网络,虽然也会时常自动断开并重连,但不会出现断点重新下载的问题。

另外关于修改connectionCount 的问题,这个我在调试中有修改过,不过很快改回了。目前发现的问题就是断点重连的时候,内存中的downloaderModelMap任务信息为null,而数据库导出后,发现任务信息存在。我会尝试在此处下手找寻问题所在。


目前又发现了一些进展,我仔细看了一下

09-18 08:39:10.413 21931-21952/com.liulishuo.filedownloader.demo:filedownloader E/FileDownloader.FileDownloadManager: -1560237150 status is[3](not finish) & but not in the pool段日志,该任务信息已经获取到,但是status3status = 3时的状态是progress状态,但是实际上线程因为sockettimeout的错误已经死亡,而状态未同步至-1error状态,故发生了此bug,原因可能出现在exception的处理上,因为未对该异常进行处理所导致的。

而在FiledownloadManager#startif (model != null &&
                (model.getStatus() == FileDownloadStatus.paused ||
                        model.getStatus() == FileDownloadStatus.error) // FileDownloadRunnable invoke
            // #isBreakpointAvailable to determine whether it is really invalid.
                ) {

该段判断认为,如果model的状态未同步至error状态,则视为null处理

根据日志

09-15 11:10:04.597 10825-10825/com.liulishuo.filedownloader.demo W/System.err:     at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:146)

 // start fetch
        FileDownloadLog.d(this, "-------------start fetch-------------");

        InputStream inputStream = null;
        FileDownloadOutputStream outputStream = null;

        try {
            final boolean isSupportSeek = CustomComponentHolder.getImpl().isSupportSeek();
            if (hostRunnable != null && !isSupportSeek) {
                throw new IllegalAccessException("can't using multi-download when the output stream can't support seek");
            }

            this.outputStream = outputStream = FileDownloadUtils.createOutputStream(path);
            if (isSupportSeek) {
                outputStream.seek(currentOffset);
            }

            if (FileDownloadLog.NEED_LOG) {
                FileDownloadLog.d(this, "start fetch(%d): range [%d, %d), seek to[%d]",
                        connectionIndex, startOffset, endOffset, currentOffset);
            }

            inputStream = connection.getInputStream();

            byte[] buff = new byte[BUFFER_SIZE];

            if (paused) return;

            do {
               // ************此处是146行,此行发生异常**************
                int byteCount = inputStream.read(buff);  
                if (byteCount == -1) {
                    break;
                }

                outputStream.write(buff, 0, byteCount);

                currentOffset += byteCount;

                // callback progress
                callback.onProgress(byteCount);

                checkAndSync();

                // check status
                if (paused) return;

                if (isWifiRequired && FileDownloadUtils.isNetworkNotOnWifiType()) {
                    throw new FileDownloadNetworkPolicyException();
                }

            } while (true);

        } finally {

            if (inputStream != null)
                try {
                    inputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }

            try {
                if (outputStream != null)
                    outputStream.sync();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (outputStream != null)
                    try {
                        outputStream.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
            }

        }

线程在read时发生异常,程序将异常上抛。程序在catch exception后处理,并且已经将status修改为-1了。DownloadStatusCallback#handleError

  model.setStatus(FileDownloadStatus.error);

但是奇怪的是,在

9-18 11:24:19.024 25214-25278/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable:  finally connection.ending()  model = id[-1560237150], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[11851497], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5

日志中,.DownloadLaunchRunnable#run 中,程序走到finally的时候,status又还原成3(progress)。
具体是哪一步又将status还原了还在验证中


已找到status状态仍然为3的一个原因,根据日志

09-18 14:45:39.421 9959-10089/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: require callback -1 but the host thread of the flow has already dead, what is occurred because of there are several reason can final this flow on different thread.

在DownloadStatusCallback#sendMessage中,因为handlerThread死亡,导致error回调失败,model的error状态未更新


有时候handlerThread未死亡,error回调成功仍然会导致状态无法更新

09-18 15:01:40.422 17407-22821/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:  DownloadStatusCallback  sendMessage handlerThread.isAlive() = true

09-18 15:01:44.802 17407-22733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[1343384], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5

但是很明显的 在DownloadLaunchRunnable中的status依然未更新,仍然是3。


更新日志

09-18 16:48:26.222 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read end    !!!!! 
09-18 16:48:26.223 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read start    !!!!! 
09-18 16:48:26.302 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:26.303 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read end    !!!!! 
09-18 16:48:26.303 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read start    !!!!! 
09-18 16:48:26.319 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable:    Error catch = java.net.SocketTimeoutException   getMessagenull   isRetry = false
09-18 16:48:26.322 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 6657672
09-18 16:48:26.342 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.342 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[0] offset[6657672], consume[23]
09-18 16:48:26.344 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 75665472
09-18 16:48:26.366 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.367 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[1] offset[75665472], consume[25]
09-18 16:48:26.369 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 145962606
09-18 16:48:26.376 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:26.376 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read end    !!!!! 
09-18 16:48:26.376 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  !!!!!   inputStream.read start    !!!!! 
09-18 16:48:26.382 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.383 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[2] offset[145965182], consume[16]
09-18 16:48:26.402 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 220347619
09-18 16:48:26.417 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.417 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[3] offset[220347619], consume[34]
09-18 16:48:26.423 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 289025644
09-18 16:48:26.434 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.434 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[4] offset[289025644], consume[16]
09-18 16:48:26.434 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:   DownloadStatusCallback onError FileDownloadStatus.error 
09-18 16:48:26.435 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:  DownloadStatusCallback  sendMessage handlerThread.isAlive() = true
09-18 16:48:26.435 25247-25377/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:  DownloadStatusCallback  handler.sendMessage(message); { when=-8h21m45s701ms what=-1 obj=java.net.SocketTimeoutException target=android.os.Handler }
09-18 16:48:26.436 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:  -----------------  handleError start --------------
09-18 16:48:26.437 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:   ****** handleError model.setStatus(FileDownloadStatus.error);  ******
09-18 16:48:26.447 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:26.451 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback:  handleNormal case.  setStatus(FileDownloadStatus.error)  model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31203387], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:26.452 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: onStatusChanged FileDownloadStatus.error  model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31203387], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:26.453 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: onStatusChanged status = -1
09-18 16:48:26.460 25247-25375/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.MessageSnapshotFlow: inflow = com.liulishuo.filedownloader.message.SmallMessageSnapshot$ErrorMessageSnapshot@2b02feea
09-18 16:48:26.535 22144-25210/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotFlow: inflow = com.liulishuo.filedownloader.message.SmallMessageSnapshot$ErrorMessageSnapshot@2ae15604
09-18 16:48:26.536 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback 461854951 old[3] new[-1] 1
09-18 16:48:26.536 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTaskHunter:  FileDownloadList  update snapshot status = -1
09-18 16:48:26.537 22144-31184/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadList: remove 461854951@com.liulishuo.filedownloader.DownloadTask@b81e077 left -1 0
09-18 16:48:26.537 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadList:   Notify 2 Listener removeByStatus = -1
09-18 16:48:26.537 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error 461854951@com.liulishuo.filedownloader.DownloadTask@b81e077 java.net.SocketTimeoutException
09-18 16:48:26.538 22144-31184/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@bbb04e4 by -1 
09-18 16:48:26.538 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger:  FileDownloadMessageStation.getImpl().requestEnqueue 
09-18 16:48:26.538 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessageStation:  ----- requestEnqueue start -----
09-18 16:48:26.539 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessageStation:  -----enqueue messenger -----
09-18 16:48:26.539 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessageStation:   FileDownloadMessageStation start push 
09-18 16:48:26.539 22144-31184/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessageStation:   sendMessageDelayed delayMillis =  10
09-18 16:48:26.550 22144-22144/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 16:48:26.553 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 145966470
09-18 16:48:26.563 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.563 25247-25379/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[2] offset[145966470], consume[14]
09-18 16:48:26.568 22144-22144/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessageStation:   FileDownloadMessageStation start push 
09-18 16:48:26.803 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:26.905 25247-25380/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:26.938 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 289026932
09-18 16:48:26.963 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:26.963 25247-25381/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[4] offset[289026932], consume[28]
09-18 16:48:27.028 25247-25380/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 220348907
09-18 16:48:27.042 25247-25380/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:27.042 25247-25380/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[3] offset[220348907], consume[17]
09-18 16:48:27.930 25247-25290/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 18. Thread differ : -1. unknown: -1 [(-)source-status-callback]
09-18 16:48:27.932 25247-25290/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 18. Thread differ : -1. unknown: -1 [(-)source-status-callback]
09-18 16:48:27.932 25247-25290/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 18. Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 14
09-18 16:48:28.497 25247-25378/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadStatusCallback: ******   model.setStatus(FileDownloadStatus.progress)   ******
09-18 16:48:28.626 25247-25378/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DefaultDatabaseImpl:  database.updateConnectionModel model 75666760
09-18 16:48:28.638 25247-25378/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel model 
09-18 16:48:28.639 25247-25378/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[461854951] index[1] offset[75666760], consume[16]
09-18 16:48:28.644 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:28.645 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:28.646 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:28.646 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:28.647 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [461854951] TRUE FALSE   model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 16:48:28.647 25247-25310/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable:  finally connection.ending()  model = id[461854951], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/0d5a0dbebb52028fcf85d5cb5b9b8e7e], status[3], sofar[31207251], total[353229748], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5

D/FileDownloader.DownloadStatusCallback: ****** handleError model.setStatus(FileDownloadStatus.error); ******

调用后,依然有

D/FileDownloader.DownloadStatusCallback: ****** model.setStatus(FileDownloadStatus.progress) ******

的回调,状态被刷新回progress,说明抛出异常后线程FetchDataTask并未死亡,依然再继续回调onProgress


Bug已经解决,明天测试完毕后,会提交正式的PR。

原因是handlerThread.quit调用后未将FileDownloadThreadPool中的runnable cancel掉,handlerThread无法初始化,从而造成has been into the launch pool的问题,导致后续一系列问题。


第一次用公司的网络完整的下载完一个350M的大文件。

Alt text

@BigExcalibur
Copy link

BigExcalibur commented Sep 18, 2017

另外再补充一个,任务从开始 ---- 下载中 ---- 出现sockettimeout 错误 ---- 开始任务 ---- 无法断点续传并重新下载
完整的流程日志。

09-18 08:36:33.798 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : +16. Binder: +3 | unknown: +13 [(+)HeapTrimmerDaemon, (+)main, (+)ReferenceQueueDaemon, (+)RenderThread, (+)Thread-343, (+)GCDaemon, (+)Signal Catcher, (+)hwuiTask2, (+)hwuiTask1, (+)ThreadDebugger, (+)FinalizerDaemon, (+)FinalizerWatchdogDaemon, (+)JDWP]
09-18 08:36:33.798 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. Binder: 3 | unknown: 13
09-18 08:36:40.462 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setListener com.liulishuo.filedownloader.demo.HybridTestActivity$3@33199523
09-18 08:36:40.463 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setTag 1
09-18 08:36:40.463 21471-21471/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: call start Url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], Path[null] Listener[com.liulishuo.filedownloader.demo.HybridTestActivity$3@33199523], Tag[1]
09-18 08:36:40.477 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setPath /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:36:40.477 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTaskHunter: save Path is null to /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:36:40.503 21471-21471/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: the task[-1560237150] has been into the launch pool.
09-18 08:36:40.525 21471-21929/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadEventPool: setListener event.service.connect.changed
09-18 08:36:40.545 21471-21929/com.liulishuo.filedownloader.demo I/FileDownloader.FileDownloadProperties: init properties 3
                                                                                                           load properties: http.lenient=FALSE; process.non-separate=FALSE; download.min-progress-step=65536; download.min-progress-time=2000; download.max-network-thread-count=3
09-18 08:36:40.567 21471-21929/com.liulishuo.filedownloader.demo D/FileDownloader.LostServiceConnectedHandler: Waiting for connecting with the downloader service... -1560237150
09-18 08:36:40.569 21471-21929/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadServiceUIGuard: bindStartByContext DemoApplication
09-18 08:36:40.623 21471-21929/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTaskHunter: free the task -1560237150, when the status is 10
09-18 08:36:41.317 21931-21931/com.liulishuo.filedownloader.demo:filedownloader I/FileDownloader.FileDownloadProperties: init properties 4
                                                                                                                          load properties: http.lenient=FALSE; process.non-separate=FALSE; download.min-progress-step=65536; download.min-progress-time=2000; download.max-network-thread-count=3
09-18 08:36:41.367 21931-21931/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue -1560237150 file not suit, exists[FALSE], directory[FALSE]
09-18 08:36:41.368 21931-21931/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:    isBreakpointAvailable true
09-18 08:36:41.380 21931-21931/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadDatabase: refreshed data count: 1 , delete data count: 0, reset id count: 0. consume 22
09-18 08:36:41.411 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadServiceUIGuard: onServiceConnected ComponentInfo{com.liulishuo.filedownloader.demo/com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService} com.liulishuo.filedownloader.i.IFileDownloadIPCService$Stub$Proxy@38924d38
09-18 08:36:41.417 21471-21471/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadEventPool: asyncPublishInNewThread event.service.connect.changed
09-18 08:36:41.420 21471-21986/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadEventPool: publish event.service.connect.changed
09-18 08:36:41.424 21471-21986/com.liulishuo.filedownloader.demo D/FileDownloader.LostServiceConnectedHandler: The downloader service is connected.
09-18 08:36:41.425 21471-21986/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: call start Url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], Path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b] Listener[com.liulishuo.filedownloader.demo.HybridTestActivity$3@33199523], Tag[1]
09-18 08:36:41.426 21471-21986/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: the task[-1560237150] has been into the launch pool.
09-18 08:36:41.428 21471-21987/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify begin -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077
09-18 08:36:41.429 21471-21987/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@bbb04e4 by 11 
09-18 08:36:41.429 21471-21987/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadList: add list in all -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 11 1
09-18 08:36:41.431 21931-21951/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: request start the task with url(http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk) path(/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b) isDirectory(FALSE)
09-18 08:36:41.436 21931-21951/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: real start -1560237150 /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:36:41.436 21931-21951/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  mDatabase.find model != null , new model id[-1560237150], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b], status[-2], sofar[84609494], total[406318295], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 08:36:41.544 21931-21951/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: execute runnable -1560237150 /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:36:41.551 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isMultiConnection = true supportSeek = true  model = id[-1560237150], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b], status[6], sofar[85033670], total[406318295], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 5
09-18 08:36:41.552 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:    isBreakpointAvailable true
09-18 08:36:41.554 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: test_ getTotalOffset 
09-18 08:36:41.555 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isResumeAvailableOnDB = true
09-18 08:36:41.562 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[11] new[1] 1
09-18 08:36:41.562 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify pending -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077
09-18 08:36:41.562 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadMgrInitialParams: initial FileDownloader manager with the customize connection creator: com.liulishuo.filedownloader.connection.FileDownloadUrlConnection$Creator@331f9304
09-18 08:36:41.571 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=85033670-]}
09-18 08:36:41.571 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[1] new[6] 1
09-18 08:36:41.572 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify started -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077
09-18 08:36:41.582 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:41.602 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:41.727 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: etag find null for task(-1560237150)
09-18 08:36:41.756 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[6] new[2] 1
09-18 08:36:41.756 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  -----------checkupBeforeFetch------------
09-18 08:36:41.757 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify connected -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077
09-18 08:36:41.768 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:41.779 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isMultiConnectionAvailable() = true
09-18 08:36:41.780 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isResumeAvailableOnDB = true
09-18 08:36:41.785 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: fetch data with multiple connection(count: [5]) for task[-1560237150]
09-18 08:36:41.792 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[0] range[0, 81263658) current offset(9727946)
09-18 08:36:41.793 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[1] range[81263659, 162527317) current offset(95657429)
09-18 08:36:41.795 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[2] range[162527318, 243790976) current offset(189845646)
09-18 08:36:41.795 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[3] range[243790977, 325054635) current offset(257823978)
09-18 08:36:41.796 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[4] range[325054636, 0) current offset(344615261)
09-18 08:36:41.810 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=257823978-325054635]}
09-18 08:36:41.819 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=9727946-81263658]}
09-18 08:36:41.823 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=344615261-]}
09-18 08:36:41.828 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=189845646-243790976]}
09-18 08:36:41.844 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=95657429-162527317]}
09-18 08:36:41.858 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 20. Thread differ : +4. FlowSingle: +1 [(+)FileDownloader-Flow-01] | Event: +1 [(+)FileDownloader-EventPool1] | LauncherTask: +2 [(+)FileDownloader-LauncherTask2, (+)FileDownloader-LauncherTask1]
09-18 08:36:41.860 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 20. Thread differ : +4. FlowSingle: +1 | Event: +1 | LauncherTask: +2
09-18 08:36:41.861 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 20. Binder: 3 | FlowSingle: 1 | Event: 1 | LauncherTask: 2 | unknown: 13
09-18 08:36:41.979 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[1] for -1560237150, is connected range[81263659, 162527317) current offset[95657429] with code[206]
09-18 08:36:41.990 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[3] for -1560237150, is connected range[243790977, 325054635) current offset[257823978] with code[206]
09-18 08:36:41.991 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:36:41.991 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:36:41.993 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[4] for -1560237150, is connected range[325054636, 0) current offset[344615261] with code[206]
09-18 08:36:41.993 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:36:41.994 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(3): range [243790977, 325054635), seek to[257823978]
09-18 08:36:41.995 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(4): range [325054636, 0), seek to[344615261]
09-18 08:36:41.994 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(1): range [81263659, 162527317), seek to[95657429]
09-18 08:36:42.008 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[2] new[3] 1
09-18 08:36:42.008 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85034803 406318295
09-18 08:36:42.019 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:42.033 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:42.042 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[257825111], consume[45]
09-18 08:36:42.071 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[2] for -1560237150, is connected range[162527318, 243790976) current offset[189845646] with code[206]
09-18 08:36:42.073 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:36:42.075 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:42.076 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344617854], consume[75]
09-18 08:36:42.079 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(2): range [162527318, 243790976), seek to[189845646]
09-18 08:36:42.089 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[0] for -1560237150, is connected range[0, 81263658) current offset[9727946] with code[206]
09-18 08:36:42.089 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:36:42.093 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(0): range [0, 81263658), seek to[9727946]
09-18 08:36:42.110 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:42.110 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[95658563], consume[108]
09-18 08:36:42.118 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:42.118 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[189849699], consume[32]
09-18 08:36:42.126 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:42.126 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[9732002], consume[30]
09-18 08:36:43.259 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 20. Thread differ : +20. OkHttp: +1 [(+)OkHttp ConnectionPool] | Binder: +2 [(+)Binder_1, (+)Binder_2] | Network: +1 [(+)FileDownloader-Network1] | FlowSingle: +1 [(+)FileDownloader-Flow-01] | unknown: +15 [(+)FileDownloader-download-executor2, (+)Signal Catcher, (+)FileDownloader-download-executor4, (+)ThreadDebugger, (+)FileDownloader-download-executor1, (+)FileDownloader-download-executor3, (+)FinalizerDaemon, (+)FinalizerWatchdogDaemon, (+)main, (+)source-status-callback, (+)GCDaemon, (+)FileDownloader-download-executor5, (+)ReferenceQueueDaemon, (+)JDWP, (+)HeapTrimmerDaemon]
09-18 08:36:43.259 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 20. Thread differ : +20. OkHttp: +1 | Binder: +2 | Network: +1 | FlowSingle: +1 | unknown: +15 [(+)FileDownloader-download-executor2, (+)Signal Catcher, (+)FileDownloader-download-executor4, (+)ThreadDebugger, (+)FileDownloader-download-executor1, (+)FileDownloader-download-executor3, (+)FinalizerDaemon, (+)FinalizerWatchdogDaemon, (+)main, (+)source-status-callback, (+)GCDaemon, (+)FileDownloader-download-executor5, (+)ReferenceQueueDaemon, (+)JDWP, (+)HeapTrimmerDaemon]
09-18 08:36:43.260 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 20. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 15
09-18 08:36:45.229 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:45.229 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[95727507], consume[32]
09-18 08:36:45.804 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:36:45.805 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85237899 406318295
09-18 08:36:45.816 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:45.872 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 19. Thread differ : -1. LauncherTask: -1 [(-)FileDownloader-LauncherTask1]
09-18 08:36:45.873 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 19. Thread differ : -1. LauncherTask: -1
09-18 08:36:45.873 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 19. Binder: 3 | FlowSingle: 1 | Event: 1 | LauncherTask: 1 | unknown: 13
09-18 08:36:46.597 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:46.598 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[257893203], consume[38]
09-18 08:36:47.224 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:47.225 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[95831775], consume[27]
09-18 08:36:47.458 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:36:47.458 21471-22003/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85442299 406318295
09-18 08:36:47.469 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:47.878 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 17. Thread differ : -2. Event: -1 [(-)FileDownloader-EventPool1] | LauncherTask: -1 [(-)FileDownloader-LauncherTask2]
09-18 08:36:47.879 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 17. Thread differ : -2. Event: -1 | LauncherTask: -1
09-18 08:36:47.879 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 17. Binder: 3 | FlowSingle: 1 | unknown: 13
09-18 08:36:49.059 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:49.060 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[257976951], consume[44]
09-18 08:36:53.321 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 19. Thread differ : -1. FlowSingle: -1 [(-)FileDownloader-Flow-01]
09-18 08:36:53.322 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 19. Thread differ : -1. FlowSingle: -1
09-18 08:36:53.323 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 19. OkHttp: 1 | Binder: 2 | Network: 1 | unknown: 15
09-18 08:36:53.755 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:53.756 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[189915399], consume[25]
09-18 08:36:53.770 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:53.771 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[95898003], consume[25]
09-18 08:36:53.891 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:36:53.891 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85647591 406318295
09-18 08:36:53.892 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:36:53.892 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85647591 406318295
09-18 08:36:53.899 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 17. Thread differ : 0. FlowSingle: SWAP [(+)FileDownloader-Flow-02, (-)FileDownloader-Flow-01]
09-18 08:36:53.902 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:53.901 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 17. Thread size has not changed.
09-18 08:36:53.905 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 17. Binder: 3 | FlowSingle: 1 | unknown: 13
09-18 08:36:53.921 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:55.330 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 20. Thread differ : +1. FlowSingle: +1 [(+)FileDownloader-Flow-02]
09-18 08:36:55.331 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 20. Thread differ : +1. FlowSingle: +1
09-18 08:36:55.331 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 20. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 15
09-18 08:36:55.872 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:55.872 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[96077299], consume[60]
09-18 08:36:55.877 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:36:55.878 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 85854627 406318295
09-18 08:36:55.889 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:36:58.797 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:58.797 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258042651], consume[22]
09-18 08:36:59.089 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:36:59.089 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344687366], consume[33]
09-18 08:37:00.468 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:00.468 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86059311 406318295
09-18 08:37:00.479 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:01.307 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:01.307 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258133171], consume[15]
09-18 08:37:01.386 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:01.391 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344753350], consume[13]
09-18 08:37:02.007 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:02.007 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[96144743], consume[20]
09-18 08:37:02.336 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:02.336 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86263995 406318295
09-18 08:37:02.346 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:02.367 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:02.368 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[189981099], consume[25]
09-18 08:37:04.140 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:04.140 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258198871], consume[33]
09-18 08:37:04.341 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:04.341 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[96289283], consume[15]
09-18 08:37:05.344 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:05.344 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86471315 406318295
09-18 08:37:05.346 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:05.347 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86471315 406318295
09-18 08:37:05.356 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:05.382 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:05.470 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:05.470 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[9797702], consume[30]
09-18 08:37:05.525 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:05.525 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344820794], consume[20]
09-18 08:37:06.130 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:06.130 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258281807], consume[22]
09-18 08:37:08.101 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:08.102 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86675999 406318295
09-18 08:37:08.112 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:08.307 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:08.307 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344896714], consume[41]
09-18 08:37:10.076 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:10.077 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258350427], consume[20]
09-18 08:37:10.200 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:10.201 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[9866038], consume[15]
09-18 08:37:10.892 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:37:10.892 21471-22562/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 86880399 406318295
09-18 08:37:10.903 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:12.006 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:12.007 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344962414], consume[22]
09-18 08:37:12.082 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:12.083 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258442691], consume[15]
09-18 08:37:15.983 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1 [(-)FileDownloader-Flow-02]
09-18 08:37:15.984 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1
09-18 08:37:15.985 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. Binder: 3 | unknown: 13
09-18 08:37:17.436 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 19. Thread differ : -1. FlowSingle: -1 [(-)FileDownloader-Flow-02]
09-18 08:37:17.437 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 19. Thread differ : -1. FlowSingle: -1
09-18 08:37:17.438 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 19. OkHttp: 1 | Binder: 2 | Network: 1 | unknown: 15
09-18 08:37:17.513 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.514 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[9896982], consume[19]
09-18 08:37:17.533 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.536 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[96325783], consume[19]
09-18 08:37:17.555 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.556 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[189982559], consume[19]
09-18 08:37:17.567 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.567 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258487951], consume[11]
09-18 08:37:17.577 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.577 21931-22014/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344993074], consume[10]
09-18 08:37:17.620 21471-23646/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[-1] 1
09-18 08:37:17.620 21471-23646/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadList: remove -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 left -1 0
09-18 08:37:17.620 21471-23646/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify error -1560237150@com.liulishuo.filedownloader.DownloadTask@b81e077 java.net.SocketTimeoutException
09-18 08:37:17.621 21471-23646/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@bbb04e4 by -1 
09-18 08:37:17.631 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:37:17.981 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:17.982 21931-22012/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[9899902], consume[20]
09-18 08:37:17.990 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 17. Thread differ : +1. FlowSingle: +1 [(+)FileDownloader-Flow-03]
09-18 08:37:17.991 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 17. Thread differ : +1. FlowSingle: +1
09-18 08:37:17.991 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 17. Binder: 3 | FlowSingle: 1 | unknown: 13
09-18 08:37:19.446 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 19. Thread differ : 0. FlowSingle: +1 [(+)FileDownloader-Flow-03] | unknown: -1 [(-)source-status-callback]
09-18 08:37:19.446 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 19. Thread size has not changed.
09-18 08:37:19.446 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 19. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 14
09-18 08:37:19.804 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:19.805 21931-22016/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[344994534], consume[31]
09-18 08:37:19.979 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:19.979 21931-22013/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[96327243], consume[26]
09-18 08:37:20.030 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:37:20.031 21931-22015/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[258492047], consume[15]
09-18 08:37:20.034 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [-1560237150] TRUE FALSE
09-18 08:37:20.035 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [-1560237150] TRUE FALSE
09-18 08:37:20.035 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [-1560237150] TRUE FALSE
09-18 08:37:20.036 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [-1560237150] TRUE FALSE
09-18 08:37:20.036 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: finish sub-task for [-1560237150] TRUE FALSE
09-18 08:37:20.037 21931-22002/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  finally connection.ending() 
09-18 08:37:23.459 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 16. Thread differ : -3. FlowSingle: -1 [(-)FileDownloader-Flow-03] | unknown: -2 [(-)FileDownloader-download-executor1, (-)FileDownloader-download-executor3]
09-18 08:37:23.460 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : -3. FlowSingle: -1 | unknown: -2 [(-)FileDownloader-download-executor1, (-)FileDownloader-download-executor3]
09-18 08:37:23.460 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. OkHttp: 1 | Binder: 2 | Network: 1 | unknown: 12
09-18 08:37:24.006 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1 [(-)FileDownloader-Flow-03]
09-18 08:37:24.007 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : -1. FlowSingle: -1
09-18 08:37:24.007 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. Binder: 3 | unknown: 13
09-18 08:37:25.468 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 12. Thread differ : -4. Network: -1 [(-)FileDownloader-Network1] | unknown: -3 [(-)FileDownloader-download-executor2, (-)FileDownloader-download-executor4, (-)FileDownloader-download-executor5]
09-18 08:37:25.469 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 12. Thread differ : -4. Network: -1 | unknown: -3 [(-)FileDownloader-download-executor2, (-)FileDownloader-download-executor4, (-)FileDownloader-download-executor5]
09-18 08:37:25.469 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 12. OkHttp: 1 | Binder: 2 | unknown: 9
09-18 08:37:43.514 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 11. Thread differ : -1. OkHttp: -1 [(-)OkHttp ConnectionPool]
09-18 08:37:43.515 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 11. Thread differ : -1. OkHttp: -1
09-18 08:37:43.515 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 11. Binder: 2 | unknown: 9
09-18 08:37:50.090 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 14. Thread differ : -2. unknown: -2 [(-)hwuiTask2, (-)hwuiTask1]
09-18 08:37:50.091 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 14. Thread differ : -2. unknown: -2 [(-)hwuiTask2, (-)hwuiTask1]
09-18 08:37:50.091 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 14. Binder: 3 | unknown: 11
09-18 08:39:02.379 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 16. Thread differ : +2. unknown: +2 [(+)hwuiTask1, (+)hwuiTask2]
09-18 08:39:02.391 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 16. Thread differ : +2. unknown: +2 [(+)hwuiTask1, (+)hwuiTask2]
09-18 08:39:02.391 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 16. Binder: 3 | unknown: 13
09-18 08:39:10.361 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setListener com.liulishuo.filedownloader.demo.HybridTestActivity$3@2135ade5
09-18 08:39:10.368 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setTag 1
09-18 08:39:10.382 21471-21471/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: call start Url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], Path[null] Listener[com.liulishuo.filedownloader.demo.HybridTestActivity$3@2135ade5], Tag[1]
09-18 08:39:10.400 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTask: setPath /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:39:10.400 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.DownloadTaskHunter: save Path is null to /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:39:10.402 21471-21471/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: the task[-1560237150] has been into the launch pool.
09-18 08:39:10.405 21471-28695/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify begin -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b
09-18 08:39:10.405 21471-28695/com.liulishuo.filedownloader.demo V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@367d46c8 by 11 
09-18 08:39:10.406 21471-28695/com.liulishuo.filedownloader.demo V/FileDownloader.FileDownloadList: add list in all -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 11 1
09-18 08:39:10.412 21931-21952/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: request start the task with url(http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk) path(/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b) isDirectory(FALSE)
09-18 08:39:10.413 21931-21952/com.liulishuo.filedownloader.demo:filedownloader E/FileDownloader.FileDownloadManager: -1560237150 status is[3](not finish) & but not in the pool
09-18 08:39:10.414 21931-21952/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: real start -1560237150 /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:39:10.415 21931-21952/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  mDatabase.find model = null , new model id[-1560237150], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b], status[1], sofar[0], total[0], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 1
09-18 08:39:10.428 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 17. Thread differ : +1. LauncherTask: +1 [(+)FileDownloader-LauncherTask3]
09-18 08:39:10.429 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 17. Thread differ : +1. LauncherTask: +1
09-18 08:39:10.430 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 17. Binder: 3 | LauncherTask: 1 | unknown: 13
09-18 08:39:10.444 21931-21952/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadManager: execute runnable -1560237150 /storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b
09-18 08:39:10.455 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[11] new[1] 1
09-18 08:39:10.456 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify pending -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b
09-18 08:39:10.457 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[1] new[6] 1
09-18 08:39:10.458 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify started -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b
09-18 08:39:10.467 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isMultiConnection = false supportSeek = true  model = id[-1560237150], url[http://imtt.dd.qq.com/16891/D5C206B2E152D565B05E086800B7DC99.apk], path[/storage/emulated/0/Android/data/com.liulishuo.filedownloader.demo/cache/9b2110b189796cd7f1fa0ddd7c6cc55b], status[6], sofar[0], total[0], etag[null], com.liulishuo.filedownloader.model.FileDownloadModel@f856ab1  connectionCount = 1
09-18 08:39:10.468 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue -1560237150 the downloaded-record is zero.  
09-18 08:39:10.470 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:    isBreakpointAvailable false
09-18 08:39:10.471 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: can't continue -1560237150 the downloaded-record is zero.  
09-18 08:39:10.472 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: buildFirstConnectProfile isResumeAvailableOnDB = false
09-18 08:39:10.495 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:10.500 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=0-]}
09-18 08:39:10.527 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:10.789 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FileDownloadUtils: etag find null for task(-1560237150)
09-18 08:39:10.899 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[6] new[2] 1
09-18 08:39:10.900 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify connected -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b
09-18 08:39:10.909 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  -----------checkupBeforeFetch------------
09-18 08:39:10.924 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:10.929 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isMultiConnectionAvailable() = true
09-18 08:39:10.930 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String:  isResumeAvailableOnDB = false
09-18 08:39:10.931 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.String: test_ determineConnectionCount = 5
09-18 08:39:11.031 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: fetch data with multiple connection(count: [5]) for task[-1560237150]
09-18 08:39:11.032 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[0] range[0, 81263658) current offset(0)
09-18 08:39:11.032 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[1] range[81263659, 162527317) current offset(81263659)
09-18 08:39:11.033 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[2] range[162527318, 243790976) current offset(162527318)
09-18 08:39:11.034 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[3] range[243790977, 325054635) current offset(243790977)
09-18 08:39:11.036 21931-28703/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadLaunchRunnable: enable multiple connection: id[-1560237150] index[4] range[325054636, 0) current offset(325054636)
09-18 08:39:11.050 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=162527318-243790976]}
09-18 08:39:11.052 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=81263659-162527317]}
09-18 08:39:11.053 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=0-81263658]}
09-18 08:39:11.054 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=325054636-]}
09-18 08:39:11.073 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.ConnectTask: -1560237150 request header {Range=[bytes=243790977-325054635]}
09-18 08:39:11.395 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[1] for -1560237150, is connected range[81263659, 162527317) current offset[81263659] with code[206]
09-18 08:39:11.396 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:39:11.397 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(1): range [81263659, 162527317), seek to[81263659]
09-18 08:39:11.402 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[2] new[3] 1
09-18 08:39:11.403 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 4096 406318295
09-18 08:39:11.416 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:11.424 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:11.424 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[81267755], consume[22]
09-18 08:39:11.431 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[2] for -1560237150, is connected range[162527318, 243790976) current offset[162527318] with code[206]
09-18 08:39:11.432 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:39:11.436 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[4] for -1560237150, is connected range[325054636, 0) current offset[325054636] with code[206]
09-18 08:39:11.437 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:39:11.438 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(2): range [162527318, 243790976), seek to[162527318]
09-18 08:39:11.440 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[0] for -1560237150, is connected range[0, 81263658) current offset[0] with code[206]
09-18 08:39:11.442 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:39:11.442 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(4): range [325054636, 0), seek to[325054636]
09-18 08:39:11.445 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(0): range [0, 81263658), seek to[0]
09-18 08:39:11.470 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:11.471 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[162528451], consume[32]
09-18 08:39:11.486 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:11.488 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[325058689], consume[39]
09-18 08:39:11.512 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.DownloadRunnable: the connection[3] for -1560237150, is connected range[243790977, 325054635) current offset[243790977] with code[206]
09-18 08:39:11.514 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: -------------start fetch-------------
09-18 08:39:11.517 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: start fetch(3): range [243790977, 325054635), seek to[243790977]
09-18 08:39:11.547 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:11.548 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[243792110], consume[25]
09-18 08:39:11.790 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 20. Thread differ : +9. OkHttp: +1 [(+)OkHttp ConnectionPool] | Network: +1 [(+)FileDownloader-Network2] | FlowSingle: +1 [(+)FileDownloader-Flow-04] | unknown: +6 [(+)FileDownloader-download-executor9, (+)FileDownloader-download-executor10, (+)FileDownloader-download-executor8, (+)FileDownloader-download-executor7, (+)source-status-callback, (+)FileDownloader-download-executor6]
09-18 08:39:11.791 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 20. Thread differ : +9. OkHttp: +1 | Network: +1 | FlowSingle: +1 | unknown: +6 [(+)FileDownloader-download-executor9, (+)FileDownloader-download-executor10, (+)FileDownloader-download-executor8, (+)FileDownloader-download-executor7, (+)source-status-callback, (+)FileDownloader-download-executor6]
09-18 08:39:11.791 21931-21977/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 20. OkHttp: 1 | Binder: 2 | Network: 1 | FlowSingle: 1 | unknown: 15
09-18 08:39:12.058 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:12.059 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 208331 406318295
09-18 08:39:12.082 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:12.436 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 18. Thread differ : +1. FlowSingle: +1 [(+)FileDownloader-Flow-04]
09-18 08:39:12.436 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 18. Thread differ : +1. FlowSingle: +1
09-18 08:39:12.437 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 18. Binder: 3 | FlowSingle: 1 | LauncherTask: 1 | unknown: 13
09-18 08:39:12.595 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:12.595 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[66842], consume[28]
09-18 08:39:13.145 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:13.146 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 414475 406318295
09-18 08:39:13.157 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:13.499 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:13.500 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[325162349], consume[41]
09-18 08:39:13.553 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:13.554 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[243894310], consume[25]
09-18 08:39:13.635 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:13.635 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[81381593], consume[13]
09-18 08:39:13.756 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:13.756 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[162645251], consume[16]
09-18 08:39:13.849 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:13.850 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 621795 406318295
09-18 08:39:13.850 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:13.851 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 623255 406318295
09-18 08:39:13.870 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:13.894 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:14.572 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:14.572 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 827655 406318295
09-18 08:39:14.583 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:14.619 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:14.620 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[193862], consume[48]
09-18 08:39:15.564 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:15.564 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[243980450], consume[31]
09-18 08:39:15.705 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:15.706 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 1033515 406318295
09-18 08:39:15.716 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:15.758 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:15.758 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[325248489], consume[25]
09-18 08:39:15.914 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:15.914 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[162729931], consume[18]
09-18 08:39:15.927 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:15.927 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[81469193], consume[30]
09-18 08:39:16.449 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadInfoDiff: Thread count = 17. Thread differ : -1. LauncherTask: -1 [(-)FileDownloader-LauncherTask3]
09-18 08:39:16.450 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSizeDiff: Thread count = 17. Thread differ : -1. LauncherTask: -1
09-18 08:39:16.450 21471-21516/com.liulishuo.filedownloader.demo D/FileDownloadApplication: drawUpEachThreadSize: Thread count = 17. Binder: 3 | FlowSingle: 1 | unknown: 13
09-18 08:39:16.661 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:16.661 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 1239375 406318295
09-18 08:39:16.672 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:16.875 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:16.875 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[260454], consume[84]
09-18 08:39:17.252 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:17.253 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 1443775 406318295
09-18 08:39:17.275 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:17.578 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:17.579 21931-28735/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[3] offset[244108930], consume[44]
09-18 08:39:17.655 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:17.656 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 1648175 406318295
09-18 08:39:17.668 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:17.799 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:17.802 21931-28736/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[4] offset[325355677], consume[47]
09-18 08:39:17.838 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:17.838 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 1854035 406318295
09-18 08:39:17.854 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:18.348 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:18.352 21931-28733/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[1] offset[81621033], consume[40]
09-18 08:39:18.407 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:18.408 21931-28734/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[2] offset[162893451], consume[19]
09-18 08:39:18.623 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:18.624 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 2058435 406318295
09-18 08:39:18.635 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false
09-18 08:39:18.842 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask:  database.updateConnectionModel 
09-18 08:39:18.842 21931-28732/com.liulishuo.filedownloader.demo:filedownloader D/FileDownloader.FetchDataTask: require sync id[-1560237150] index[0] offset[510682], consume[47]
09-18 08:39:18.935 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.MessageSnapshotGate: ~~~callback -1560237150 old[3] new[3] 1
09-18 08:39:18.935 21471-28704/com.liulishuo.filedownloader.demo D/FileDownloader.FileDownloadMessenger: notify progress -1560237150@com.liulishuo.filedownloader.DownloadTask@12662b6b 2264295 406318295
09-18 08:39:18.946 21471-21471/com.liulishuo.filedownloader.demo D/FileDownloader.String: handoverMessage     mIsDiscard = false

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

3 participants