Well, I looked at the patch and it seems like it really is not the right
solution to this problem. As I understand it, the problem is due to the
runforkhandler which is executed in the child. By design, it assumes
continuation and is not aware that it's being prepared for an exec() call.
Hence it does things that need not be done like create a new poller. This
is a design flaw and the proposed update is putting in unnecessary checks
to cover up that design flaw. There are three solutions to this problem:

1) When registering a fork handler, tell the fork handler what the
intention is (i.e. continuation at fork or it's for an exec() call). If
it's for an exec call then the child handler should not be reinitializing
the newly created process. In fact, one could simply no-op the whole
cheld part as it's useless work. That would avoid the problem, albiet it
would requrie an application change to make use of this.

2) If you want to avoid the ABI change (which I think is the correct
solution). Tell the newly created poller that it being created due to a
fork(). This would allow the poller to simply ignore EBADF and simply
exit the thread when it gets the error. Unfortuantely, this would
potentially mask other problems that are legitmate errors but that's
another issue.

3) The poller could initialize a static variable with the original process
number. Should it get an EBADF error it could check if that is in the
original process or in a new process and exit the thread assuming that
it's due to the forkhandler design flaw. This is simply a variation of
(2).

Any of these solutions would avoid having to litter the code with tests
for "poller error" to cover up the fork handler's ignorance in this
particular case.

So, I wouldn't apply this patch.

Andy


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/issues/1198#issuecomment-856979940", "url": "https://github.com/xrootd/xrootd/issues/1198#issuecomment-856979940", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1