You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by SMorettini February 7, 2024
Since I started using fprime-gds, I've encountered the following error when starting it multiple times in a row:
[ERROR] Error with address/port '0.0.0.0:50050' : [Errno 98] Address already in use
This error doesn't occur every time but it seems to happen at least one out of ten times. My usual workaround is to change the --tts-port.
Upon investigation today, I found out what I suspected to be the problem. In flask/app.py, a pipeline is created but the disconnect method is never called. I attempted to add the call to disconnect but couldn't find a way to do so.
The pipeline is created only once when starting fprime-gds. Any request uses the same pipeline object. As far as I understand, Flask doesn't support the design of using the same object across all API requests. According to Flask's suggested design, each API function should create a new connection to the TCPServer. Therefore, Flask doesn't provide a way to register a function to clean up or teardown a global object.
I tried to register a signal_handler but it seems that Flask gives very little time for any signal handling, forcing the server to close too quickly and not allowing the disconnect method to complete execution.
Has anyone else encountered the Address already in use error? How did you solve it? Any ideas on how we could change fprime-gds to close more cleanly?
The text was updated successfully, but these errors were encountered:
The --zmq flag removes the need of a middleware application occupying port 50050, using ZMQ instead of a TCP server being the middleman. We will probably make --zmq flag the default, removing this issue altogether.
Until a GDS release comes out, fprime-gds --zmq --zmq-server should work. Not using --zmq-server results in the bug in the current GDS version
Discussed in #2519
Originally posted by SMorettini February 7, 2024
Since I started using fprime-gds, I've encountered the following error when starting it multiple times in a row:
This error doesn't occur every time but it seems to happen at least one out of ten times. My usual workaround is to change the
--tts-port
.Upon investigation today, I found out what I suspected to be the problem. In
flask/app.py
, a pipeline is created but thedisconnect
method is never called. I attempted to add the call todisconnect
but couldn't find a way to do so.The pipeline is created only once when starting
fprime-gds
. Any request uses the same pipeline object. As far as I understand, Flask doesn't support the design of using the same object across all API requests. According to Flask's suggested design, each API function should create a new connection to theTCPServer
. Therefore, Flask doesn't provide a way to register a function to clean up or teardown a global object.I tried to register a
signal_handler
but it seems that Flask gives very little time for any signal handling, forcing the server to close too quickly and not allowing thedisconnect
method to complete execution.Has anyone else encountered the
Address already in use
error? How did you solve it? Any ideas on how we could change fprime-gds to close more cleanly?The text was updated successfully, but these errors were encountered: