multiprocessing managers and socket connection.

Chris chris0wj at
Tue Aug 25 16:14:12 CEST 2009

I've been using multiprocessing managers and I really like the

I have a question about reconnecting to a manager. I have a situation
where I start on one machine (A) a manager that is listening and then
on another machine (B) connects to that manager and uses its proxy
object to call functions on the manager's computer; this all works as
expected. But, if the manager from A shuts down, B's application won't
notice because in the MP code it ignores socket error
errno.ECONNREFUSED. If A becomes available again or is restarted, B
doesn't automatically reconnect either and continue its operation.
It's function is basically stopped.

Here is the code from
while 1:
        except socket.error, e:
            if e.args[0] != errno.ECONNREFUSED: # connection refused
                debug('failed to connect to address %s', address)

How can I have B automatically reconnect to A and continue its work
once A is available again?

More information about the Python-list mailing list