Skip to content

Commit 3f947a3

Browse files
pcncdarora
authored andcommitted
chore: fix AIO signal handling; propagate exit signal to all child process
1 parent 67a862c commit 3f947a3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/dockerhub-release-aio.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- develop
7+
- pcnc/fix-aio-signal-handling
78
paths:
89
- ".github/workflows/dockerhub-release-aio.yml"
910
- "docker/all-in-one/*"

docker/all-in-one/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
146146
less \
147147
libnuma1 \
148148
logrotate \
149+
dumb-init \
149150
# pg_egress_collect deps
150151
tcpdump libio-async-perl \
151152
&& rm -rf /var/lib/apt/lists/* /tmp/* \
@@ -283,4 +284,6 @@ COPY docker/all-in-one/postgres-entrypoint.sh /usr/local/bin/
283284
COPY docker/all-in-one/shutdown.sh /usr/local/bin/supa-shutdown.sh
284285
COPY docker/all-in-one/run-logrotate.sh /usr/local/bin/run-logrotate.sh
285286

286-
ENTRYPOINT [ "entrypoint.sh" ]
287+
ENTRYPOINT [ "/usr/bin/dumb-init" ]
288+
289+
CMD [ "entrypoint.sh"]

docker/all-in-one/entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,11 @@ function push_lsn_checkpoint_file {
6363

6464
function graceful_shutdown {
6565
echo "$(date): Received SIGINT. Shutting down."
66-
supervisorctl stop postgresql
6766

6867
# Postgres ships the latest WAL file using archive_command during shutdown, in a blocking operation
6968
# This is to ensure that the WAL file is shipped, just in case
7069
sleep 0.2
7170
push_lsn_checkpoint_file
72-
73-
kill -s TERM "$(supervisorctl pid)"
7471
}
7572

7673
function enable_autoshutdown {
@@ -188,6 +185,12 @@ function start_supervisor {
188185

189186
# Start supervisord
190187
/usr/bin/supervisord -c $SUPERVISOR_CONF
188+
189+
# SUPERVISORD_PID=$(supervisorctl pid)
190+
191+
# while [ -e "/proc/$SUPERVISORD_PID" ]; do
192+
# sleep 5
193+
# done
191194
}
192195

193196
# Increase max number of open connections

0 commit comments

Comments
 (0)