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

修复在分片下载的协程中,因为关闭文件不及时造成的最后完成rename时提示文件被占用的错误 #60

Closed
wants to merge 1 commit into from

Conversation

bryant24
Copy link

@bryant24 bryant24 commented Aug 1, 2017

使用断点续传多线程方式下载文件,线上使用后发现,经常会出现rename xxx.zip.temp yyy.zip:the process cannot access the file because it is being used by another process 的错误导致下载失败
temp文件已经下载成功,但是最后重命名Rename的时候会出现这个错误

发现在下载分片的协程中,使用了defer来进行temp文件描述符的关闭,这样可能会造成多分片的情况下,result 管道已经通知,但是temp的fd还未及时关闭,很大概率会导致rename时出现文件被占用

@CLAassistant
Copy link

CLAassistant commented Aug 1, 2017

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Aug 1, 2017

Coverage Status

Coverage decreased (-51.7%) to 39.121% when pulling 2028dda on bryant24:fix-rename-process-being-used into dee3ad3 on aliyun:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants