Bug: local start-api hangs on exit in Windows10
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
After `local start-api` shell is provided with `Ctrl+C` keystroke and the environment starts shutting down it hangs along with the underlying Python process.
### Steps to reproduce:
1. `sam --debug local start-api -n env_vars.json -t template.yaml --config-env qa --docker-network bridge --debug --warm-containers EAGER`
2. The environment is up and running, accepting requests, processes them
3. Press `Ctrl+C`
4. The environment starts the shutdown sequence
5. It hangs not even responding to subsequent Ctrl+C keystrokes
### Observed result:
```
2022-08-24 13:13:08,423 | Terminating all running warm containers
2022-08-24 13:13:08,423 | Terminate running warm container for Lambda Function 'A1Function'
2022-08-24 13:13:09,911 | Terminate running warm container for Lambda Function 'AuthorizerFunction'
2022-08-24 13:13:10,413 | Terminate running warm container for Lambda Function 'A2Function'
2022-08-24 13:13:12,377 | Terminate running warm container for Lambda Function 'A3Function'
2022-08-24 13:13:14,917 | Terminate running warm container for Lambda Function 'A4Function'
2022-08-24 13:13:15,396 | Terminate running warm container for Lambda Function 'A5Function'
2022-08-24 13:13:15,954 | Cleaning all decompressed code dirs
```
The local environment has 4 layers attached. The environment hangs after printing the last line shown. It's in the hanging state for more than an hour by the time of filing this issue.
### Expected result:
The environment shuts down and returns control to the CMD application.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: Windows10
2. `sam --version`: SAM CLI, version 1.55.0, installed from the official `.msi` package.
6. AWS region: us-east-1
7. The lambdas' environment is Python3.9, x86_64, Linux (docker, running in WSL2)
Contributor guide
Assessment
This issue has not been assessed yet.