Docker stuck frozen in "running" status

Question:

I have a Docker container running python code on an ubuntu 20 image, the host is also ubuntu 20.

Inconsistently sometimes the container just gets stuck / freezes.
Logs stop being added to the console, the docker’s status is "running".

Even when I try to kill the process that runs the python code inside the Docker, it does not affect it, the process does not die.

Restarting the container solves it.

I put a Python code into my service that listens to a specific signal and when I send the signal it should print the stack trace for me, but as mentioned, the processor does not respond to my signals…

Does anyone have an idea what is causing this or how I can debug it?

Asked By: Yinon_90

||

Answers:

The problem was that the code used the requests.post function without setting a timeout, the server was probably not available or changed address (Docker’s internal network) and it just waited there.

Answered By: Yinon_90