OxfordIonTrapGroup / wand

Wavemeter Analysis aNd Display
Apache License 2.0
13 stars 13 forks source link

clients should not die when a server restarts #15

Closed hartytp closed 5 years ago

hartytp commented 5 years ago

When the server dies, the gui quits with the message

WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified ne
twork name is no longer available
ERROR:wand.frontend.wand_gui:Connection to server 'lab3' lost, closing
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 437, in finish_recv
    return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 240
, in _step
    result = coro.send(None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 88, in close
    await asyncio.wait_for(self.receive_task, None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 387
, in wait_for
    return (yield from fut)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
83, in __iter__
    return self.result()  # May raise too.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 242
, in _step
    result = coro.throw(exc)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 100, in _receive_cr
    line = await self.reader.readline()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
82, in readline
    line = yield from self.readuntil(sep)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 5
75, in readuntil
    yield from self._wait_for_data('readuntil')
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
58, in _wait_for_data
    yield from self._waiter
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
81, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 310
, in _wakeup
    future.result()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\proactor_events.py"
, line 189, in _loop_reading
    data = fut.result()  # deliver data later in "finally" clause
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\quamash-0.5.5
-py3.6.egg\quamash\_windows.py", line 41, in _process_events
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 440, in finish_recv
    raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer avai
lable
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 437, in finish_recv
    return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 240
, in _step
    result = coro.send(None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 88, in close
    await asyncio.wait_for(self.receive_task, None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 387
, in wait_for
    return (yield from fut)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
83, in __iter__
    return self.result()  # May raise too.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 242
, in _step
    result = coro.throw(exc)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 100, in _receive_cr
    line = await self.reader.readline()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
82, in readline
    line = yield from self.readuntil(sep)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 5
75, in readuntil
    yield from self._wait_for_data('readuntil')
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
58, in _wait_for_data
    yield from self._waiter
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
81, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 310
, in _wakeup
    future.result()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\proactor_events.py"
, line 189, in _loop_reading
    data = fut.result()  # deliver data later in "finally" clause
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\quamash-0.5.5
-py3.6.egg\quamash\_windows.py", line 41, in _process_events
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 440, in finish_recv
    raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer avai
lable
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\pc_rpc.py", line 246, in close_rpc
    self.__writer.close()
AttributeError: 'NoneType' object has no attribute 'close'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 437, in finish_recv
    return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 240
, in _step
    result = coro.send(None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 88, in close
    await asyncio.wait_for(self.receive_task, None)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 387
, in wait_for
    return (yield from fut)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
83, in __iter__
    return self.result()  # May raise too.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 242
, in _step
    result = coro.throw(exc)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\sync_struct.py", line 100, in _receive_cr
    line = await self.reader.readline()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
82, in readline
    line = yield from self.readuntil(sep)
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 5
75, in readuntil
    yield from self._wait_for_data('readuntil')
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\streams.py", line 4
58, in _wait_for_data
    yield from self._waiter
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 3
81, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\tasks.py", line 310
, in _wakeup
    future.result()
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\proactor_events.py"
, line 189, in _loop_reading
    data = fut.result()  # deliver data later in "finally" clause
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\futures.py", line 2
94, in result
    raise self._exception
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\quamash-0.5.5
-py3.6.egg\quamash\_windows.py", line 41, in _process_events
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\asyncio\windows_events.py",
 line 440, in finish_recv
    raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer avai
lable
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\localadmin\Anaconda3\envs\artiq\lib\site-packages\artiq\protoco
ls\pc_rpc.py", line 246, in close_rpc
    self.__writer.close()
AttributeError: 'NoneType' object has no attribute 'close'
hartytp commented 5 years ago

The disconnect_cbs in the GUI were set to kill the app (unlike the locker, which implements auto reconnection). However, when I hook them up, they never seem to get called. I get a large number of errors like

WARNING:quamash.QEventLoop:Event callback failed: [WinError 64] The specified network name is no longer available
DEBUG:quamash.QEventLoop:Registering callback <bound method _ProactorReadPipeTransport._loop_reading of <_ProactorSocketTransport fd=1020 read=<_OverlappedFuture finished overlapped=<completed, 0x63b4790> exception=ConnectionResetError(22, 'The specified network name is no longer available', None, 64, None)>>> to be invoked with arguments (<_OverlappedFuture finished overlapped=<completed, 0x63b4790> exception=ConnectionResetError(22, 'The specified network name is no longeravailable', None, 64, None)>,) after 0 second(s)
DEBUG:quamash.QEventLoop:Adding callback <Handle _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ne, 64, None)>)> with delay 0
DEBUG:quamash.QEventLoop:Invoking event callback <function IocpProactor.recv.<locals>.finish_recv at 0x00000000063B92F0>