Module yaque::recovery[][src]

Recovery utilities for queues left in as inconsistent state, based on “best effort” strategies. Use these functions if you need to automatically recover from a failure.

Functions

guess_recv_metadata

Guesses the receive metadata for a given queue. This equals to the bottom position in the smallest segment present in the directory or the existing receiver metadata, whichever is greater. The reason for this is that the receive metadata is a lower bound of where the receiver actually was and this guess is always lower than that.

guess_recv_metadata_with_loss

Guesses the receive metadata for a given queue. This equals to the bottom position in the segment after the smallest one present in the directory. This function will substitute the current receive metadata by this guess upon acquiring the receive lock on this queue.

recover

Recovers a queue, appliying the following operations, in this order:

recover_with_loss

Recovers a queue, appliying the following operations, in this order:

unlock

Unlocks a lock file if the owning process does not exist anymore. This function does nothing if the file does not exist.

unlock_for_receiving

Unlocks a queue in a given directory for receiving. This function returns an error of kind io::ErrorKind::Other when the process listed in the lockfile still exists.

unlock_for_sending

Unlocks a queue in a given directory for sending. This function returns an error of kind io::ErrorKind::Other when the process listed in the lockfile still exists.

unlock_queue

Unlocks a queue in a given directory for both sending and receiving. This function is the combination of unlock_for_sending and unlock_for_receiving.