pyre icon indicating copy to clipboard operation
pyre copied to clipboard

beacon is dead after network error

Open vim-zz opened this issue 8 years ago • 1 comments

I have the following scenario on which there is a network problem during beacon setup, where I get the following exception inside ZBeacon:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyre/zbeacon.py", line 118, in prepare_udp
    socket.IP_ADD_MEMBERSHIP, mreq)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 19] No such device

The problem is that the caller cannot know it happened as the exception was triggered inside ZActor which has it's own thread (using Threading package).

vim-zz avatar Mar 20 '17 14:03 vim-zz

I would like to revive this issue and discuss possible solutions to this issue.

  1. The udp beacon setup happens on sending CONFIGURE + <port> to the actor. The actor reacts by answering with the address. How about answering with <empty string> (or an other token) on udp beacon setup failure? The user could test for the token and act appropriately.
  2. Implement an ALIVE command that returns a boolean indicating a possible failure of the beacon. The user can check the answer and reinitiate the setup if required.

papr avatar Aug 29 '17 12:08 papr