Wednesday, March 30, 2011

Using ScosTerminate() + ScosDesignateBackup(NULL)

Do NOT use ScosDesignateBackup(NULL) to un-designate the backup application right after or right before ScosTerminate().
Indeed, first function will cause a SCOS_UNDESIGNATE_BACKUP to be sent to primaryworker, and second function will cause a TERMINATE to be enqueued in the ringbuffer. First message will be read by the main thread of the primaryworker.
TERMINATE will be read by the consumer thread of the primaryworker. As both threads then call send_destroy_bkup_obj_store_and_die_msg() and FtTerminate(), there will be a race condition that may lead to no SCOS_TERMINATE_RESP being sent back by the primaryworker.