[英]ECS Agent stops and re-starts Docker container when paused Spring Boot Java app in remote debug
I noticed a problem, when I remote debug a SpringBoot app running in ECS docker container on EC2 instance (managed by task), if I pause for too long (say, need to research or talk to team members) - after about 10 minutes, AWS kills the container and starts it again because it is not considered alive.我注意到一个问题,当我远程调试在 EC2 实例(由任务管理)上的 ECS docker 容器中运行的 SpringBoot 应用程序时,如果我暂停太久(例如,需要研究或与团队成员交谈) - 大约 10 分钟后, AWS 杀死容器并重新启动它,因为它不被认为是活着的。
I assume that is because the breakpoint is paused on all threads.我认为这是因为断点在所有线程上都暂停了。
I don't know what race conditions I may introduce, if I were to pause only on the current thread so didn't try modifying that.我不知道我可能会引入什么竞争条件,如果我只在当前线程上暂停,所以没有尝试修改它。
Is there any recommended way to handle this situation, when needing to remote debug?当需要远程调试时,有什么推荐的方法来处理这种情况吗?
You can check ECS service event to know exactly why your task got terminated, most likely the task is considered as unhealthy
.您可以检查 ECS 服务事件以确切了解您的任务被终止的原因,很可能该任务被认为是
unhealthy
的。 If yes, one of the below things can be done:如果是,则可以执行以下操作之一:
Ideally, for debugging and development purpose, we can avoid remote debugging with AWS task by running your application in your local system.理想情况下,出于调试和开发目的,我们可以通过在本地系统中运行您的应用程序来避免使用 AWS 任务进行远程调试。 If you need any AWS infra structure to bootstrap/run your application, you can just login and retrieve access token before.
如果您需要任何 AWS 基础架构来引导/运行您的应用程序,您可以先登录并检索访问令牌。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.