Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/postgresql] Make SIGINT default stopsignal #40519

Open
dgeissl opened this issue Jul 10, 2023 · 4 comments
Open

[bitnami/postgresql] Make SIGINT default stopsignal #40519

dgeissl opened this issue Jul 10, 2023 · 4 comments
Assignees
Labels
feature-request on-hold Issues or Pull Requests with this label will never be considered stale postgresql

Comments

@dgeissl
Copy link

dgeissl commented Jul 10, 2023

Name and Version

bitnami/postgresql*

What is the problem this feature will solve?

The default stop signal for containers seems to be SIGTERM which will lead to a greaceful shutdown, waiting for any connections until they are closed before terminating the postgresql process. This can be seen in the Log during shutdown:

[1] LOG:  received smart shutdown request

The downside is that your typical runtime does not wait forever (docker stop 10s, k8s 30s) and will just kill your process if it did not finish within that timeframe:

[134] FATAL:  terminating connection due to unexpected postmaster exit

this will likely cause data corruptions and has been discussed in the Docker "Official Image".

What is the feature you are proposing to solve the problem?

The discussion docker-library/postgres#714 resulted in changing the default termination signal to SIGINT (see docker-library/postgres#763).

I think it would also be beneficial to make this the default on bitnami images.
Changing the behavior by the docker-compose.yaml led to the following log output that looked way better than before:

[1] LOG:  received fast shutdown request
[1] LOG:  aborting any active transactions
[1] LOG:  background worker "logical replication launcher" (PID 86) exited with exit code 1
[81] LOG:  shutting down

What alternatives have you considered?

We can change the signal in our own derived images.
on the docker cli with docker run ---stop-signal=SIGINT
of for docker compose with:

version: '3.6'
services:
  postgres:
    stop_signal: SIGINT
    image: bitnami/postgresql

In kubernetes there seems to be a ongoing discussion kubernetes/kubernetes#30051 to support that but it's currently only possible if you build your own image (at least that's what I found).

Having said that I'll fix this in my derived images, but one should consider making that the default.

@github-actions github-actions bot added the triage Triage is needed label Jul 10, 2023
@javsalgar javsalgar changed the title [postgresql] Make SIGINT default stopsignal [bitnami/postgresql] Make SIGINT default stopsignal Jul 10, 2023
@javsalgar
Copy link
Contributor

javsalgar commented Jul 10, 2023

Hi!

Thank you so much for the feature request! I will forward it to the engineering team.

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Jul 26, 2023
@dgeissl
Copy link
Author

dgeissl commented Jul 26, 2023

@javsalgar is this smth your team want's to work on or should I ignore the stale notification next time as it won't be tackeled anyways?

@javsalgar javsalgar added the on-hold Issues or Pull Requests with this label will never be considered stale label Jul 26, 2023
@javsalgar
Copy link
Contributor

Hi,

I'm afraid the task is still in the backlog. I added the on-hold label so the stale bot does not close it.

@github-actions github-actions bot removed the stale 15 days without activity label Jul 27, 2023
@carrodher carrodher removed the triage Triage is needed label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request on-hold Issues or Pull Requests with this label will never be considered stale postgresql
Projects
None yet
Development

No branches or pull requests

3 participants