fprime-gds: Pipeline not correctly disconnected #2519
SMorettini
started this conversation in
General
Replies: 1 comment 1 reply
-
Yes this is a common error, we never really prioritized fixing it because of the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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?Beta Was this translation helpful? Give feedback.
All reactions