-
Notifications
You must be signed in to change notification settings - Fork 778
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
java.io.IOException: The current offset on block-info isn't update #511
Comments
我下载的是102兆的,也非常容易出现这种情况。是必现的 |
按其他issue里的方法继承MultiPointOutputStream在close里加上noSyncLengthMap.remove(blockIndex);但是依旧会出现,用16进制编辑器查看出错的位置发现实际上下载到了东西,并不是00占位,所以直接在这个继承类里重写write把统计已下载长度计数用其他方式承载,比如
判断长度也改成用这个
我发现每次totalSize统计出来都是完整的,暂时没去细究为什么CurrentOffset会有问题,感觉像同步数据时候在多线程里搞丢了 |
我觉得罪魁祸首应该是那个done不是同步方法。。继承下来改成同步就一切正常了 |
@axel8888 你测试了吗?可以具体说下修改那个方法吗 |
测试了,就是其他帖子里继承ProcessFileStrategy和MultiPointOutputStream的方法,然后把done方法改成synchorized就行了 |
😅,你这消息太老了。okdownload 代码量最大的贡献者已经单独开工程了,把你上面说的那两个问题已经修改代码了 |
改完我这里都很正常从没再出现过那个报错 |
你用的那个帖子的修改方式,给贴个链接 |
为了跟大家分享我这几天的成果,我特意去把我的github账户验证了
|
catch unknown error
java.io.IOException: The current offset on block-info isn't update correct, 48176155 != 53291524 on 7
at com.liulishuo.okdownload.core.file.MultiPointOutputStream.inspectComplete(MultiPointOutputStream.java:264)
at com.liulishuo.okdownload.core.interceptor.BreakpointInterceptor.interceptFetch(BreakpointInterceptor.java:123)
at com.liulishuo.okdownload.core.download.DownloadChain.processFetch(DownloadChain.java:241)
at com.liulishuo.okdownload.core.interceptor.RetryInterceptor.interceptFetch(RetryInterceptor.java:57)
at com.liulishuo.okdownload.core.download.DownloadChain.processFetch(DownloadChain.java:241)
at com.liulishuo.okdownload.core.download.DownloadChain.start(DownloadChain.java:211)
at com.liulishuo.okdownload.core.download.DownloadChain.run(DownloadChain.java:276)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
下载的是你提供的500m那个zip,很容易出现这个异常,用的是你另一个工程https://github.com/tianshaokai/okdownload?tab=readme-ov-file,我设置了多线程下载,google手机
The text was updated successfully, but these errors were encountered: