Here, to distinguish between the new worker and the previous one let's add a
new process state PROC_O_INIT and let's set it, when the memory is allocated
for the new worker in the processes list.
#define PROC_O_TYPE_PROG 0x00000004
/* 0x00000008 unused */
#define PROC_O_LEAVING 0x00000010 /* this process should be leaving */
-/* 0x00000020 to 0x00000080 unused */
+/* state of the newly forked worker process, which hasn't sent yet its READY message to master */
+#define PROC_O_INIT 0x00000020
+/* 0x00000040 to 0x00000080 unused */
#define PROC_O_START_RELOAD 0x00000100 /* Start the process even if the master was re-executed */
/*
ha_alert("Cannot allocate process structures.\n");
exit(EXIT_FAILURE);
}
- tmproc->options |= PROC_O_TYPE_WORKER; /* worker */
-
+ /* worker */
+ tmproc->options |= (PROC_O_TYPE_WORKER | PROC_O_INIT);
/* create a sockpair to copy it via fork(), thus it will be in
* master and in worker processes
*/