GithubHelp home page GithubHelp logo

Comments (6)

jconway avatar jconway commented on May 27, 2024

Looks correct to me.

from crunchy-containers.

jmccormick2001 avatar jmccormick2001 commented on May 27, 2024

combined the start-pg-wrapper.sh and start.sh scripts into a single start.sh script to be consistent other containers in the suite, added a change to start.sh script to exec postgres, this allows SIGTERM (docker stop) to reach postgres whereby a clean postgres shutdown can be achieved.

from crunchy-containers.

jconway avatar jconway commented on May 27, 2024

Converting SIGTERM to SIGINT is important. See:

https://www.postgresql.org/docs/9.5/static/server-shutdown.html

If you send SIGTERM, postgres will wait on any existing connections, which means it could wait a very long time. If that happens docker stop times out and postgres gets killed as before.

With SIGINT, a "fast shutdown" is done. This produces a clean shutdown while not waiting on existing connections. SIGINT is what we need here.

from crunchy-containers.

jmccormick2001 avatar jmccormick2001 commented on May 27, 2024

ah!

from crunchy-containers.

jmccormick2001 avatar jmccormick2001 commented on May 27, 2024

it appears to be working now..I put an explicit trap in the script to catch both INT and TERM
signals, when caught, it will send SIGINT to the postgres to stop it....

the pg log shows the following message to indicate the shutdown...

2016-11-02 11:52:33 EDT [27]: [4-1] user=,db=,app=,client=LOG: received fast shutdown request

from crunchy-containers.

jconway avatar jconway commented on May 27, 2024

Perfect -- thanks!

from crunchy-containers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.