aws / aws/session-manager-plugin
Address behavior of an open session when the endpoint becomes unresponsive
- Dominant language
- Go
- Stars
- 320
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
## The issue
If I have an open session-manager-plugin session and the endpoint running [amazon-ssm-agent](https://github.com/aws/amazon-ssm-agent) stops responding, my session-manager-plugin shell will become unresponsive for an indeterminate amount of time.
Would it make sense and be feasible for the session-manager-plugin to detect an unresponsive endpoint and end the session-manager-plugin process itself, returning control to the parent process?
I recognize that there are many factors to consider; for example, how long to wait before considering the endpoint unresponsive, or whether to allow overriding that time to wait.
If it is decided that this behavior is not worth supporting, could documentation be added to state that session-manager-plugin will never terminate itself when the endpoint becomes unresponsive? At least that would provide some official documentation that I can point to in my projects.
I am unsure whether this issue should go here or in [the Systems Manager forums](https://repost.aws/tags/TA-UbbRGVYRWCDaCvae6itYg?forumID=185&start=225), since it depends on what end you guys feel the issue should be handled.
This issue is independent of https://github.com/aws/session-manager-plugin/issues/6, but a solution to that issue would minimize the need for a solution to this issue.
## My use case
I am connecting to ECS Fargate containers via session-manager-plugin. I have been using session-manager-plugin directly, but the issue is also reproducible with `aws ecs execute-command`.
If I have an open session with one of my containers and then the container dies, my shell session will freeze. I can go to the AWS Systems Manager Session Manager dashboard and manually terminate the session, which will return control of my shell to me.
It would be much more convenient in my eyes for the session-manager-plugin itself to detect an unresponsive endpoint and automatically end itself.
This behavior can be reproduced by starting up an ECS Fargate task with the execute agent enabled and with an entrypoint of `sleep 180`, then connecting with `session-manager-plugin` and waiting 3 minutes. At that point, the session-manager-plugin shell will become unresponsive.
My session-manager-plugin version is `1.2.339.0`.
My containers are running on Fargate platform version `1.4.0`.
Contributor guide
Assessment
This issue has not been assessed yet.