CaltechOpticalObservatories / NGPS

NGPS Software
2 stars 0 forks source link

GUI can fail to connect to sequencer #55

Closed astronomerdave closed 1 week ago

astronomerdave commented 4 weeks ago

If the sequencer is restarted while the ngps-observe GUI is running, the GUI fails to communicate with the sequencer. Presumably the GUI has stale file descriptors. It doesn't report any error, it just doesn't do anything. Consider catching this state and automatically reconnect to the sequencer.

chazshapiro commented 1 week ago

Is the OS daemon (and other daemons) fully shutting down its socket? GUI is already programmed to notice when connection goes bad, but it's acting as though connection is still open.

astronomerdave commented 1 week ago

The Sequencer closes his end. What is the GUI programmed to do when it notices the connection "goes bad"?

It appears to be the case that unless the Sequencer is running prior to the GUI, the GUI will not talk to it.

It also appears to be the case that, if the Sequencer shuts down and gets restarted while the GUI is running, the GUI will no longer talk to it, requiring the GUI to then be restarted.

chazshapiro commented 1 week ago

When the connection goes bad the GUI is supposed to flip the button in the connections panel from green to red, and clicking it again is supposed to reconnect. When JM and I were looking at it while starting/stopping sequencerd, the GUI was not noticing the connection had ended.

So I think DH and JM need to spend some time sorting out why the connection seems to persist on the GUI end. Once that's fixed, I can add the reconnect logic wherever it's needed (extra buttons, automatic refresh, etc).

chazshapiro commented 1 week ago

Fixed by editing logic of GUI socket connections. Importantly, state of the socket must be checked by trying a command. Also I refactored while working on this.