[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Patch] Re: Tainaron pinger problem



Hi,

Marco wrote:
>> Ah! Maybe that is the key to fixing the bug that I see at intervals. I've
>> also noticed that my mixminion server seems to lock up and needs a restart.
>> There is never anything in the log and it *always* seems to happen at midnight.
> I can confirm; happens every 2 - 3 week, always at midnight and
>  require a server restart.

I've noticed that the actual key rotation (ServerKeyring.updateKeys) is
scheduled at the next known key event. Unless there are already future keys
awaiting validation, this will be the removal of the currently used packet
key.
New keys will be generated as needed, but there's no additional (earlier)
key event scheduled and the keys won't actually be updated before the old
key is destroyed, i.e. after PublicKeyOverlap.
Restarting the server triggers the missing keyring re-initialisation, and
the ney key gets used.

If this guess is right, as a possible fix we could schedule an additional
update after creation of new keys. This should update the keyring when the
new key becomes valid, and in the worst case, a superfluous update should
not hurt...

===== Beginn =====

--- ServerMain.py
+++ ServerMain.py
@@ -745,6 +745,10 @@
             self.keyring.lock()
             self.keyring.createKeysAsNeeded()
             self.updateKeys(lock=0)
+            # Schedule another key update when new key becomes valid
+            self.scheduleEvent(OneTimeEvent(
+                self.keyring.getNextKeyRotation(),
+                self.updateKeys))
             if self.config['DirectoryServers'].get('Publish'):
                 self.keyring.publishKeys()
             return self.keyring.getNextKeygen()

===== Ende =====

Cheers.