Code Monkey home page Code Monkey logo

Comments (4)

xunchangguo avatar xunchangguo commented on May 17, 2024

补充下:
通过“OSS控制台客户端(Windows)”下载完成后的文件和用SDK下载出现 i/o timeout后的已经下载的文件对比发现,大小是一样的,用2进制比较工具比较,内容也是一样的。
怀疑:实际文件大小和通过接口获取的不一致,通过接口获取的文件大小大

from aliyun-oss-go-sdk.

xunchangguo avatar xunchangguo commented on May 17, 2024

有时候,出现“unexpected EOF”,只要出现了错误,协程不退出,导致文件被占用,下载最新版本sdk,说是解决了协程不退出问题,试了,问题依旧啊,没有解决啊!

from aliyun-oss-go-sdk.

baiyubin avatar baiyubin commented on May 17, 2024

read ... i/o timeout 是网络超时,分片下载出错后,下载的文件是无效,这点需要优化。请问什么情况下出现 unexpected EOF ?

from aliyun-oss-go-sdk.

xunchangguo avatar xunchangguo commented on May 17, 2024

这么久了,总算有个回复的了。不过我也是只能“呵呵”了,最终还是都得靠自己啊。自己修改代码,解决了。
1、协程不退出,使用sync.WaitGroup解决,错误代码:
for completed < len(parts) {
.............................
select {
case <-results:
completed++
ps[part.Index] = part
case err = <-failed:
close(die)
return err
}
2、unexpected EOF ,出错代码
_, err = fd.Seek(part.Start, os.SEEK_SET)
if err != nil {
failed <- err
break
}
_, err = io.Copy(fd, rd)
if err != nil {
failed <- err
break
}
解决方式,可参照AWS SDK的实现方式和思路

from aliyun-oss-go-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.