简体   繁体   中英

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.

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 . If yes, one of the below things can be done:

  1. Change the params to make it longer before it's considered as unhealthy
  2. Disable healthcheck, if you are using Application LB routing by Instance, this one will not allowed

Ideally, for debugging and development purpose, we can avoid remote debugging with AWS task by running your application in your local system. If you need any AWS infra structure to bootstrap/run your application, you can just login and retrieve access token before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM