ets-labs / python-dependency-injector

Dependency injection framework for Python
https://python-dependency-injector.ets-labs.org/
BSD 3-Clause "New" or "Revised" License
3.69k stars 295 forks source link

Exception doesn't bubble up: instead, it's swallowed and prevents container from restarting #781

Open ffissore opened 5 months ago

ffissore commented 5 months ago

Hi all. As per the subject, we use dependency injector in one of our services. Part of the setup phase is to connect to the database and initialise all the prepared statements. In CI, the database takes some time to get up and running, so some statements fail to be prepared. This is an expected situation and we rely on the exception bubbling up and causing the process to terminate, and be restarted by docker compose.

However, this does happen. The exception is logged, but the process doesn't terminate.

We tried a handful of times to create a Minimum, Reproducible Example, but we failed. Maybe some have seen and found the cause or a workaround for this issue?