tedsmitt / ecsgo

Provides an interactive prompt to connect to ECS Containers using the ECS ExecuteCommand API.
Apache License 2.0
81 stars 13 forks source link

detect hanging sessions #19

Closed morph027 closed 1 year ago

morph027 commented 2 years ago

When i'm in a session and the container get's removed due to new deplyoment/scaling/..., the session hangs forever and the only way is to kill the ecsgo PID.

Is there a possibility to keep track of the websocket state somehow and exit with a message after a certain timeout?

P.S.: Great project anyways, thank you! :heart:

morph027 commented 2 years ago

Hm....looks to be present already. Different mechanism?

SessionId: ecs-execute-command-0f0a8dbc107109cb4 : Your session timed out due to inactivity and has been terminated.
tedsmitt commented 2 years ago

Hey @morph027 thanks for the issue!

I've noticed this as well in the past - I think this is handled by the session-manager-plugin, whether there is something we can do from our side (ecsgo) to remedy this I'm not sure...

I have had similar issues using tools like gossm, I probably need to test and see if this happens when using the vanilla aws cli (i.e. aws ecs execute-command).

morph027 commented 2 years ago

Jeah, def. from session manager. The latter error/warning is okay, if it times out it's just like this. The first one is a bit annoying but tbh i've only encountered this a few times, probably other network related issues, so no dealbreaker.