[][src]Module yaque::recovery

Recovery utilities for queues left in as inconsistent state. Use these functions if you need to automatically recover from a failure.

This module is dependent on the recovery feature, which is enabled by default.

Functions

guess_send_metadata

Guesses the send metadata for a given queue. This equals to the top position in the greatest segment present in the directory. This function will substitute the current send metadata by this guess upon acquiring the send lock on this queue.

recover

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.