labrad / servers

LabRAD servers
24 stars 21 forks source link

Board groups not properly removed in ghz_fpga_server when DE server disconnects #235

Closed maffoo closed 9 years ago

maffoo commented 9 years ago

From @jwenner in #234:

If I start DE, then start fpga, then close DE, then fpga still thinks the boards are connected. The messages from fpga upon closing DE are:

2015-10-06 16:27:30-0700 [ServerProtocol,client] Refreshing client connection...

2015-10-06 16:27:30-0700 [ServerProtocol,client] Loading board group definitions
 from registry...
2015-10-06 16:27:30-0700 [ServerProtocol,client] Board group definitions loaded.

2015-10-06 16:27:30-0700 [ServerProtocol,client] Board group definitions ok.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "Vince Direct Ethernet"
 (port 3) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "hercules_direct_ethern
et" (port 2) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "santo_direct_ethernet"
 (port 0) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "DR Direct Ethernet" (p
ort 0) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "ivan_direct_ethernet"
(port 0) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "runningman_direct_ethe
rnet" (port 1) does not exist. Group will not be added.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Adapter "rottmayer_direct_ether
net" (port 2) does not exist. Group will be removed.
2015-10-06 16:27:30-0700 [ServerProtocol,client] Board groups to be added: set([
])
2015-10-06 16:27:30-0700 [ServerProtocol,client] Board groups to be removed: set
([('rottmayer_direct_ethernet', 2L)])
2015-10-06 16:27:31-0700 [ServerProtocol,client] Unhandled error in Deferred:
2015-10-06 16:27:31-0700 [ServerProtocol,client] Unhandled Error
        Traceback (most recent call last):
        Failure: labrad.types.Error: (0) no such server: 5 [payload=None]

At this point, ghz_fpgas.list_devices() will still list the devices before closing DE. Upon restarting DE, the list of boards will be updated to what is now connected.

maffoo commented 9 years ago

It looks like that 'no such server' error is coming from the manager when trying to expire contexts on a server that has disconnected (the ghz fpga server runs the same board group shutdown code whether or not the direct ethernet server has disconnected): https://github.com/martinisgroup/servers/blob/master/GHzDACs/ghz_fpga_server.py#L298