The younger brother is working on a multi-process crawling service recently. now it is a master process with 10 sub-processes. if the sub-process unexpectedly exits, create a sub-process. However, if the main process unexpectedly exits the sub-process, it will not quit. The next time I create 10 sub-processes in this service, the total number will be 20... the younger brother is working on a multi-process crawling service recently. now it is a master process with 10 sub-processes. if the sub-process unexpectedly exits, create a sub-process.
However, if the main process unexpectedly exits the sub-process, it will not exit. The next time I open this service, I create 10 sub-processes. The total number is 20 sub-processes. in this way, not only the data in redis is messy, but the memory is also is there any good way to ensure that the main process is closed together with the following sub-processes if it unexpectedly ends ??
My idea is that every time the main process is started, exec executes the next shell script to close all the processes except the main process. I don't know what you think?
Reply content:
The younger brother is working on a multi-process crawling service recently. now it is a master process with 10 sub-processes. if the sub-process unexpectedly exits, create a sub-process.
However, if the main process unexpectedly exits the sub-process, it will not exit. The next time I open this service, I create 10 sub-processes. The total number is 20 sub-processes. in this way, not only the data in redis is messy, but the memory is also is there any good way to ensure that the main process is closed together with the following sub-processes if it unexpectedly ends ??
My idea is that every time the main process is started, exec executes the next shell script to close all the processes except the main process. I don't know what you think?