I have a parent which when it starts, kicks off a thread that creates an instance of TCP Server that listens on port X. After this, the parent starts forking off child processes (which do few things and exit). Note that these child processes inherit fds from parent and hence end up listening on port X.
The parent program has a handler for requests coming in on port X but the child process has no such handler (it is a os.execv()-ed C++ program)
I know that child process could close all fds, in which case the above situation will not arise. What happens to a incoming request on port X? How is it processed?
Here's what i have observed so far... The tcp request handler in the parents executes commands.getstatusoutput(..) when it receives a request. Most of the times, it behaves as expected (or the way i expected) - execution of the above command without any errors ...but occasionally i get
File "/home/y/lib/python2.7/commands.py", line 61, in getstatusoutput
sts = pipe.close()
IOError: [Errno 10] No child processes