In a Python 3.8 application a parent process is responsible for creating child processes (workers) and forwarding messages to them via IPC (tasks).
Parent process has its own logger that uses FileHandler to write to a file main.log but it also opens one logger per child process with a unique file for each of them to log IPC activity and errors.
Child processes are created via system call fork. IPC is done via OS queues. See below diagram that illustrates the situation.
The problem: while it is beneficial to log IPC activity on the parent process side and keep it in a dedicated file, this opens a lot of File Descriptors (FDs) which are all inherited by each and every subsequent child process.
Question: how to manage these FDs? Manually find and close them in each child process on run()? Is there a better way?
