Ivan Vilata i Balaguer wrote:

>En/na Andrew Straw ha escrit::
>
>  
>
>>I've finally had a chance to play around with this a little bit, and
>>I've found the only thing that makes my hdf5 files resistant to my
>>program being terminated (e.g. with "kill -9" while in the middle of a
>>time.sleep() call).
>>[...]
>>    
>>
>
>Ummm, killing a process with SIGKILL (kill -9) terminates it ipso facto
>without giving it any chance of flushing, storing unsaved data, or
>cleaning up.  It should only be used when a process refuses to terminate
>by other means.
>  
>
'kill -9' should also be used when trying to simulate other events that
bring down my program hard. This is particularly important when checking
if PyTables/HDF5 maintains an internally-consistent file state between
saves.

It's not that I normally end my programs with 'kill -9', it's just that
I've found PyTables (recent versions, anyway) usually leaves my files in
an internally-inconsistent state and I'm trying to make my application
more fault tolerant.

>PyTables registers a cleanup handler (it flushes and closes open files)
>that runs on program exit.  Python is only able to run the handler on
>normal program termination or on exception termination.  Interrupting a
>process with SIGINT (Control-C) is also seen as an exception, so you
>could try to kill your process using ``kill -INT`` or ``kill -2``.  This
>may be helpful in your particular case.  Bye!
>  
>
Thanks, I'm aware of that feature, but it doesn't solve the problem when
the interpreter doesn't get a chance to call the registered functions.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to