socket question:socket.error:(4,'Interrupted system call')
donn at drizzle.com
Mon Dec 17 08:02:29 CET 2001
Quoth =?gb2312?B?1cXJ2bPb?= <zhangsc at neusoft.com>:
| I have compiled a program to deal with Zombie process which caused by child process,it follows:
| while 1:
| def sig_chld(signum, frame):
| if ret==0: #child process
| It raise a error:
| Traceback (most recent call last):
| File "d88.py", line 26, in ?
| socket.error: (4, 'Interrupted system call')
| Why is error? How to correct it? Any ideas will be appreciated.
You asked for SIGCHLD, it arrived during recv() and interrupted it.
This would happen with C just as it would in Python. In C it might
be worth your while to deal with it, but Python is so awkward with
signals anyway that in my opinion it's better to avoid them - no
I'm not sure I understand how the sig_chld handler fits into your
application, but if possible, I would simply call waitpid() at some
convenient interval to reap zombie processes.
Donn Cave, donn at drizzle.com
More information about the Python-list