Persistent "Failed to download image due to 'connect ECONNREFUSED /var/run/balena-engine.sock" error

I’ve been looking at this and I think I have some ideas. I suspect one kind of failure may be OOM on the Pi0. Another kind seems to be watchdog related.

I’ve changed the service watchdog to 60 minutes instead of 6 minutes and that seems to fix it

It looks like the balena daemon is spawning the untar process which is quite slow on mmc for large images. I suspec that watchdog responses are being blocked during untar. Maybe this needs to be looked at? Perhaps putting the responses in a thread whilst the untar operates.