On Wed, Dec 2, 2009 at 1:49 AM, Evan Daniel <evanbd at gmail.com> wrote:
> On Tue, Dec 1, 2009 at 12:30 PM, xor <xor at gmx.li> wrote:
>>
>> - The autoupdater MUST call plugin.terminate() before unloading the plugin
>> because plugins use databases and those must be properly closed.
>>
>> - Deadlock bugs however might prevent plugins from terminating properly,
>> terminate() might not return.
>>
>> So the question is: If a bug is introduced which permanently breaks
>> terminate(), even after restarting the node, will the autoupdater handle
>> that?
>>
>> IMHO if it is told to update a plugin and the node is restarted in between
>> then it should update the plugin before even starting it after the restart.
>> That would prevent this issue
>>
>> Further, toad please remember that you should add logic to the node which
>> calls terminate() on all plugins before node shutdown, otherwise the
>> WoT/Freetalk databases might get corrupted, resulting in un-debuggle weird
>> issues.
>
> Surely the on-disk database is always in a valid (or at least
> recoverable) state? ?That is one of the points of using a database,
> right? ?That it can recover to a valid state after a software or
> hardware crash, such as abrupt termination of the program or loss of
> power?

Crashing a program would clean the (os-level) file locks,
close the file handle, etc......

If the database use java.nio.channels.FileLock,
it would corrupt badly when you reopen the file
in the same process.

>
> Evan Daniel

Reply via email to