cms-dev / cms

Contest Management System
http://cms-dev.github.io/
GNU Affero General Public License v3.0
888 stars 360 forks source link

CWS: problems downloading some files. #198

Closed veluca93 closed 10 years ago

veluca93 commented 11 years ago

On my installation of CMS (http://cms.di.unipi.it/), I get empty files trying to download some files (for example the statement of the task spiedini), while I can download them without problems from AWS.

lw commented 11 years ago

It's possible that, for some reason, CWS's file cache contains an empty file for that digest, whereas AWS's does not.

This is probably my fault, as I introduced some bugs in FileCacher in https://github.com/cms-dev/cms/commit/4bf6ea5ff0c966af68f000cc59e82319af5e7d2f. We're working to fix them.

In the meantime, as a workaround, clear CWS's cache: rm -rf /var/local/cache/cms/fs-cache-ContestWebServer-0/

https://github.com/cms-dev/cms/issues/154 is also related.

veluca93 commented 11 years ago

If that was the cause, then probably they were empty because i ran out of disk space at some point.. I was quite sure I had already deleted that folder, but evidently that didn't happen...

giomasce commented 10 years ago

For the record, the problems in lerk's commit is that FileCacher.load() doesn't move the file atomically, so if some file is requested while another transfer is in progress, the second requestor receives a partial copy of the file. The cache is fixed when the first copy is finished (which could never happen if the transfer is interrupted for some reason).