MINOR: mworker: add and set state PROC_O_INIT for new worker

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.
This commit is contained in:
Valentine Krasnobaeva 2024-10-09 15:44:25 +02:00 committed by Willy Tarreau
parent 26ad5465cc
commit 646299fc95
2 changed files with 5 additions and 3 deletions

View File

@ -24,7 +24,9 @@
#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 */
/*

View File

@ -2095,8 +2095,8 @@ static void init(int argc, char **argv)
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
*/