Skip to content

fix: RuntimeError Cannot handle container in state created.#116

Open
Gogowitsch wants to merge 1 commit intolitestar-org:mainfrom
Gogowitsch:patch-1
Open

fix: RuntimeError Cannot handle container in state created.#116
Gogowitsch wants to merge 1 commit intolitestar-org:mainfrom
Gogowitsch:patch-1

Conversation

@Gogowitsch
Copy link
Copy Markdown

This PR fixes the RuntimeError: Cannot handle container in state created.

Containers in the state "created" are now removed in _service.py.

I am not sure why the container was stuck in the "created" state. In the debugger, I waited to see if it would transition into "running", but it didn’t.

Here is my call stack:
grafik

This PR fixes the RuntimeError: Cannot handle container in state created.

I am not sure why the container was stuck in the "created" state. In the debugger, I waited to see if it would transition into "running", but it didn’t.

Here is my call stack:
(insert picture)
@provinzkraut
Copy link
Copy Markdown
Member

provinzkraut commented Apr 1, 2026

Mhm. I think instead of always deleting such a container, we should wait a bit and then check if it transitioned to running, which is what's supposed to happen. If the container does not transition into a running state after some fixed timeout, then we could raise an exception / terminate the container.

Reason being is that killing containers in created state is that they will always be in there at some point, and therefore this could create an infinite loop.

@Gogowitsch
Copy link
Copy Markdown
Author

Regarding @provinzkraut’s comment: I’ll attempt to write a timeout and a test. Let’s see if I can get the situation reproduced in pytest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants