As explained in Chapter 1, Introduction, it is important to understand that actors do not explicitly declare themselves restartable, that is, there is no function call to declare an actor restartable at the start of its main() program. Instead, an actor can be run as a restartable actor. More precisely, an actor can be run as either a direct or indirect restartable actor:
Direct restartable actors
are loaded and run using the C_INIT
command arun(1M) with the -g option.
Indirect restartable actors are spawned from restartable actors using the hrfexec(2RESTART) family of API calls. hrfexec() calls function similarly to afexec(2K) calls, but provide an additional PmmName parameter used to identify them for the purposes of actor restart:
#include <hr/hr.h> int hrfexecve( PmmName * baseName, const char * path, KnCap * cactorcap, const AcParam * param, char const * argv, char const * envp); (...)
This distinction between direct and indirect actors is important for understanding the automatic restart mechanism provided by the Hot Restart Controller. When an error occurs, the Hot Restart Controller will first stop all actors in the group, and then only restart the concerned direct restartable actors. These actors, re-executed from their initial entry point, are responsible for restarting any indirect actors they may have spawned. An illustration of this is provided in Figure 1-3.