Skip to content

Commit

Permalink
Increase timeout to avoid killing the core during shutdown (home-assi…
Browse files Browse the repository at this point in the history
…stant#45029)

Stopping the core goes through several stages, which can take up to
120s, 60s and 30s respectively. However, if shutdown is taking longer
than 60s overall, s6 isn't patient and kills the core:
Jan 10 23:56:58 homeassistant eb034fca9c7d[407]: s6-svwait: fatal: timed out
Jan 10 23:56:58 homeassistant eb034fca9c7d[407]: [s6-finish] sending all processes the TERM signal.
Jan 10 23:57:01 homeassistant eb034fca9c7d[407]: [s6-finish] sending all processes the KILL signal and exiting.

This is most of the time not a problem since shutdown is quicker than
that.

However, increasing the timeout is especialy useful to debug cases when
an event is hanging, since the core will point it out after its timeout
elapsed.

Set the timeout to 220s, which is all core timeouts plus 10s grace time.
  • Loading branch information
agners authored Jan 11, 2021
1 parent ab25c5a commit 54064b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}

# Synchronize with homeassistant/core.py:async_stop
ENV \
S6_SERVICES_GRACETIME=60000
S6_SERVICES_GRACETIME=220000

WORKDIR /usr/src

Expand Down

0 comments on commit 54064b4

Please sign in to comment.