Author lvroyce
Recipients lvroyce
Date 2013-02-01.10:43:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359715424.77.0.356613938118.issue17097@psf.upfronthosting.co.za>
In-reply-to
Content
We create our customised manager which will fork child process with baseManager. Because we registered SIGCHLD to reap the zombie for manager, we found this causes baseManager raise RemoteError when called twice.(Test script attached.)

After look at baseManager.py we found recv() in handling the request has been interrupted by comming SIGCHLD, not retry recv(), but raise to client side directly.
try:

                methodname = obj = None

                request = recv()<------------------this line been interrupted by SIGCHLD

                ident, methodname, args, kwds = request

                obj, exposed, gettypeid = id_to_obj[ident]

                if methodname not in exposed:

                    raise AttributeError(

                        'method %r of %r object is not in exposed=%r' %

                        (methodname, type(obj), exposed)

                        )

                function = getattr(obj, methodname)
                try:

                    res = function(*args, **kwds)

                except Exception, e:

                    msg = ('#ERROR', e)

                else:

                    typeid = gettypeid and gettypeid.get(methodname, None)

                    if typeid:

                        rident, rexposed = self.create(conn, typeid, res)

                        token = Token(typeid, self.address, rident)

                        msg = ('#PROXY', (rexposed, token))

                    else:

                        msg = ('#RETURN', res)
            except AttributeError:
                if methodname is None:
                    msg = ('#TRACEBACK', format_exc())
                else:
                    try:
                        fallback_func = self.fallback_mapping[methodname]
                        result = fallback_func(
                            self, conn, ident, obj, *args, **kwds
                            )
                        msg = ('#RETURN', result)
                    except Exception:
                        msg = ('#TRACEBACK', format_exc())

            except EOFError:
                util.debug('got EOF -- exiting thread serving %r',
                           threading.current_thread().name)
                sys.exit(0)

            except Exception:<------does not handle IOError,INTR here should retry recv() 
                msg = ('#TRACEBACK', format_exc())
History
Date User Action Args
2013-02-01 10:43:44lvroycesetrecipients: + lvroyce
2013-02-01 10:43:44lvroycesetmessageid: <1359715424.77.0.356613938118.issue17097@psf.upfronthosting.co.za>
2013-02-01 10:43:44lvroycelinkissue17097 messages
2013-02-01 10:43:44lvroycecreate