Container restart semantics ignored?

Scenario

  1. Balena deployment with two containers, A and B. Both are marked as restart: unless-stopped in the docker-compose.yml file.
  2. Manually stop container A using the Balena console.
  3. Update an environment variable for container B.

Expected behaviour

Only container B should be restarted.

Observed behaviour

Both containers A and B are restarted.

Issue

Why are the unless-stopped restart semantics for container A not being observed? It was manually stopped, so why is it being restarted? Is there a way to work around this?

Thanks,
Peter

1 Like

Hi. Environment variables are documented here. Setting device-wide environment variables will restart all services. On the other hand, setting service variables (Device Service Variables in the device’s dashboard page) will only restart the affected service, which is the behavior you want.

On the other hand, setting service variables (Device Service Variables in the device’s dashboard page) will only restart the affected service, which is the behavior you want.

That’s not what I’m observing, though, which is why I started this thread.

Which supervisor version is your device running? Is this the first time you are seeing this issue?

Which supervisor version is your device running?

BalenaOS 2.58.6+rev1 with Supervisor 11.14.0, running on a Raspberry Pi 4.

Is this the first time you are seeing this issue?

No, but it’s the first time it’s become relevant, so I decided to confirm that it’s systematically reproducible.

I was able to reproduce this and opened an issue in the supervisor repo: https://github.com/balena-io/balena-supervisor/issues/1549. Thanks for reporting it :v:

I was able to reproduce this and opened an issue in the supervisor repo: https://github.com/balena-io/balena-supervisor/issues/1549.

That’s great. Thanks!