[Voyage-linux] print ioerror in python script

RenZO (spam-protected)
Thu Dec 20 08:31:05 HKT 2012


Hello all,

I encountered a problem with my Python script.
In this one, a job performs a task 40 times per second.
And in the loop, there is two print lines (about 20 char, going to stdout).
Everything works fine for 1 week, then the python script stops.
It means there has been about 50 million of prints before the crash !

The error from stderr is :

    print "my_message"
IOError: [Errno 28] No space left on device

Then, the python process is finished and a bash script (which started it the first time) restarts it.
So, can we expect that the buffer is flushed? No, every 40 sec, it will crash again and again.
I tried with python -u (for unbuffered), same problem.
Of course, the disk is not empty :

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                7.4G  803M  6.2G  12% /
none                 1007M  132K 1006M   1% /dev
/dev/disk/by-label/ROOT_FS
                      7.4G  803M  6.2G  12% /
tmpfs                1009M   29M  981M   3% /lib/init/rw
varrun               1009M   52K 1009M   1% /var/run
varlock              1009M     0 1009M   0% /var/lock
tmpfs                1009M  4.0K 1009M   1% /dev/shm
tmpfs                1009M     -     -   -  /tmp
tmpfs                1009M   29M  981M   3% /var/log
tmpfs                1009M   29M  981M   3% /var/tmp


$ df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
rootfs                489600   34505  455095    8% /
none                  220234    2076  218158    1% /dev
/dev/disk/by-label/ROOT_FS
                      489600   34505  455095    8% /
tmpfs                 221678     474  221204    1% /lib/init/rw
varrun                221678      22  221656    1% /var/run
varlock               221678       3  221675    1% /var/lock
tmpfs                 221678       3  221675    1% /dev/shm
tmpfs                 221678      10  221668    1% /tmp
tmpfs                 221678     474  221204    1% /var/log
tmpfs                 221678     474  221204    1% /var/tmp


I manage to restart the python script manually and it works again, without error.
So I guess the problem is linked to the parent process (bash script), but I wonder ;
In which system file does the print command write ? Could we flush it ?

Thanks.

-- 
++
RenZO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.voyage.hk/pipermail/voyage-linux/attachments/20121220/5e4ace98/attachment.html>


More information about the Voyage-linux mailing list