Wed 20 Feb 2013 12:41:56 AM UTC, original submission:
MLDonkey dies if the harddisk is full. Details in <http://mldonkey.sourceforge.net/forums/viewtopic.php?p=32224#32224>
Briefly:
"""
Nobody helped Sad.
I bited the bullet and dived into the OCaml (ouch!, I am a C/Python guy Smile. I found the issue and solved it with two lines of code.
The problem is this: Periodically, MLDonkey does a fake write to verify that it cat write to the harddisk. It catches some failures there, but doesn't catch this one: DISK FULL.
So, if the disk is full, the write will fail, the failure is not going to be recognized as "temporal" but "terminal", and mldonkey simply dies.
But the HardDisk is suppose to not be full ever. MLDonkey will stop downloading with the free space is below 50MB. But a) some other program could be writing to the same partition at the same time and b) the free space check is done once per minute, so if the download speed is high, you could not notice the diskfull until it already full.
The patch is quite simple. In production for two weeks now, no side effects:
$ diff -u ./src/utils/cdk/unix2.ml.old ./src/utils/cdk/unix2.ml
--- ./src/utils/cdk/unix2.ml.old 2013-02-04 03:19:58.000000000 +0100
+++ ./src/utils/cdk/unix2.ml 2013-02-04 03:21:47.000000000 +0100
@@ -224,6 +224,8 @@
| Unix.Unix_error (Unix.EACCES, , ) ->
lprintf_nl "can not create files in directory %s, check rights..." dirname;
exit 73
+ | Unix.Unix_error (Unix.ENOSPC,_,_) ->
+ lprintf_nl "Directorio %s lleno..." dirname;
| Unix.Unix_error (Unix.ENOENT, , ) ->
(try
safe_mkdir dirname;
"""
|