<div dir="ltr">Hi everybody<div><br></div><div>I a came across a surprising problem when using the epoll based reactor.<br></div><div>(ticket here <a href="https://twistedmatrix.com/trac/ticket/6796">https://twistedmatrix.com/trac/ticket/6796</a>)</div>
<div><br></div><div>As you can see on the ticket, the epoll object seems to share some state even after fork. </div><div>Which means even after having forked the process, making some changes to the inherited epoll object in one process may impact the one existing in another process !</div>
<div><br></div><div>This problem is only related to epoll based reactor, poll and select behave correctly.<br></div><div>I'm aware that some may say that this in not a twisted related problem (but an epoll issue), but I'm addressing my question here to try to figure out what would be the best workaround for this problem in a twisted based project ?</div>
<div><br></div><div>And for information this is what I have already tryed:</div><div>- I though about using poll or select reactor, but this is not possible, cause as i'm writing a library I do not decide which reactor will be installed by the person who want to use it.<br>
</div><div>(Besides as epoll is now the default reactor installed, I certainly want my library to work with it !)</div><div><br></div><div>- Using spawnProcess as mentioned in the ticket comment, is not an option too, in my case, I need to share some state between the main process and subprocess. (I have on object in main process space that I want to inherit in all subprocess)</div>
<div><br></div><div>- I (desperately) tryed to re-initialize the reactor._poller object after each fork to set it with a new object, but it was just a very bad idea ! :)</div><div><br></div><div>Thank you, in advance, for any possible clue ! </div>
<div>(for information, my project is here <a href="https://github.com/Grindizer/scaletix">https://github.com/Grindizer/scaletix</a>)</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br>
</div></div>