Skip to content

Commit

Permalink
Refresh database connection pool after a broken connection exception
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdean committed Nov 24, 2023
1 parent e0ae9fa commit 387e135
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 73 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

## 2.3.0

- Refresh database connection pool after a broken connection exception

- Updated the upload and download of GPX files to include the OSMAnd XML
namespace (only if required) and updated the format of the OSMAnd waypoint
`color` attribute. The `color` and additional OSMAnd extended waypoint
attributes are now stored as JSON in a new `external_attributes` column in
`itinerary_waypoint`. The database schema must be updated using the
`itinerary_waypoint`. The **database schema must be updated** using the
`trip-server --upgrade` option, which also converts and removes the existing
`color` column. Make a backup before running the upgrade.

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile-postgis.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- mode: dockerfile; -*- vim: set ft=dockerfile:
FROM postgres:15.4-bookworm
FROM postgres:15-bookworm
LABEL uk.co.fdsd.tripserver.postgis.version="@PACKAGE_VERSION@"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.2+dfsg-1+b1
ENV POSTGIS_SCRIPTS_VERSION 3.3.2+dfsg-1
RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
&& apt-get full-upgrade --yes --allow-change-held-packages \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR
RUN apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_SCRIPTS_VERSION \
&& rm -rf /var/lib/apt/lists/*
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: dockerfile; -*- vim: set ft=dockerfile:
FROM debian:12.2-slim AS build
FROM debian:bookworm-slim AS build
RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip
RUN apt-get update \
Expand Down Expand Up @@ -45,13 +45,14 @@ RUN make install install-html install-pdf

WORKDIR /usr/local/etc

FROM debian:12.2-slim
FROM debian:bookworm-slim
LABEL uk.co.fdsd.tripserver.version="@PACKAGE_VERSION@"

RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip

RUN apt-get update \
&& apt-get full-upgrade --yes --allow-change-held-packages \
&& apt-get install -y --no-install-recommends \
locales tzdata \
libboost-locale1.74.0 libpugixml1v5 libyaml-cpp0.7 \
Expand Down
5 changes: 0 additions & 5 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@

1. Build the `trip-server-2` image:

1. If necessary, copy the `trip server` distribution tarball to the root
source folder to build the Docker image. E.g.

$ vagrant upload trip-${VERSION}.tar.xz /home/vagrant/build/

1. Run the Docker build:

$ cd ./trip-server-2
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([trip],[2.3.0-rc.1],[frank.dean@fdsd.co.uk])
AC_INIT([trip],[2.3.0],[frank.dean@fdsd.co.uk])
BOOTSTRAP_VERSION='5.3.2'
OPENLAYERS_VERSION='7.5.2'
PROJ4JS_VERSION='2.9.1'
Expand Down
42 changes: 24 additions & 18 deletions po/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: trip 2.0.0\n"
"Report-Msgid-Bugs-To: Frank Dean <frank.dean@fdsd.co.uk>\n"
"POT-Creation-Date: 2023-11-20 15:52+0000\n"
"PO-Revision-Date: 2023-11-20 15:58+0000\n"
"POT-Creation-Date: 2023-11-24 14:41+0000\n"
"PO-Revision-Date: 2023-11-22 16:57+0000\n"
"Last-Translator: Frank Dean <frank@fdsd.co.uk>\n"
"Language-Team: English (British) <(nothing)>\n"
"Language: en_GB\n"
Expand Down Expand Up @@ -105,8 +105,8 @@ msgstr "Leave password fields blank, unless changing password."

#. Label for input new password for a user
#: src/admin_user_edit_handler.cpp:85
#: trip-server-common/src/http_request_handler.cpp:686
#: trip-server-common/src/http_request_handler.cpp:696
#: trip-server-common/src/http_request_handler.cpp:694
#: trip-server-common/src/http_request_handler.cpp:704
msgid "Password"
msgstr "Password"

Expand Down Expand Up @@ -1275,42 +1275,42 @@ msgstr "OsmAnd category (type)"
msgid "OsmAnd color"
msgstr "OsmAnd colour"

#: src/main.cpp:106
#: src/main.cpp:107
msgid "The database is not ready for use. Cannot find the \"{1}\" table."
msgstr "The database is not ready for use. Cannot find the \\\"{1}\\\" table."

#. Message output when the database is being upgraded
#: src/main.cpp:113
#: src/main.cpp:114
msgid "Upgrading the database"
msgstr "Upgrading the database"

#. Label for the version text of the application
#: src/main.cpp:125
#: src/main.cpp:127
msgid "version"
msgstr "version"

#. Label for the web address the application is listening at
#: src/main.cpp:127
#: src/main.cpp:129
msgid "listening at"
msgstr "listening at"

#. Output when the application has been built to allow serving static files.
#: src/main.cpp:133
#: src/main.cpp:135
msgid "The application has been built to serve static files."
msgstr "The application has been built to serve static files."

#. Displays the name of the directory that static files will be served from.
#: src/main.cpp:137
#: src/main.cpp:139
msgid "Static files will be served from the {1} directory."
msgstr "Static files will be served from the {1} directory."

#. Message showing how long the application took to startup in milliseconds
#: src/main.cpp:155
#: src/main.cpp:157
msgid "Started application in {1} ms"
msgstr "Started application in {1} ms"

#. Text displayed when the application ends
#: src/main.cpp:161
#: src/main.cpp:163
msgid "Bye!"
msgstr "Bye!"

Expand Down Expand Up @@ -1393,7 +1393,6 @@ msgstr "New password"
#. " <span ng-show=\"passwordStrength == 4\">Very strong</span>\n"
#. Displays estimate password crack time. HTML span element is replaced with value at runtime.
#: src/password_change_handler.cpp:83
#, fuzzy
msgid ""
"Estimated <span id=\"crack-time\"></span> to crack with ten attempts per "
"second."
Expand Down Expand Up @@ -1944,7 +1943,7 @@ msgstr "User is not authorised for the requested operation"

#. Title for the login page
#: src/trip_request_handler.cpp:74
#: trip-server-common/src/http_request_handler.cpp:708
#: trip-server-common/src/http_request_handler.cpp:716
msgid "Login"
msgstr "Login"

Expand Down Expand Up @@ -1998,20 +1997,27 @@ msgstr "Configuration filename not specified\n"
msgid "Reading configuration from {1}"
msgstr "Reading configuration from {1}"

#. Shows how many worker processes are still running when the application is stopping
#: trip-server-common/src/application.cpp:148
msgid "Stopping {1} worker"
msgid_plural "Stopping {1} workers"
msgstr[0] "Stopping {1} worker"
msgstr[1] "Stopping {1} workers"

#. Shows how many worker processes are being created for the application
#: trip-server-common/src/application.cpp:160
#: trip-server-common/src/application.cpp:177
msgid "Creating {1} worker"
msgid_plural "Creating {1} workers"
msgstr[0] "Creating {1} worker"
msgstr[1] "Creating {1} workers"

#: trip-server-common/src/http_request_handler.cpp:664
#: trip-server-common/src/http_request_handler.cpp:674
#: trip-server-common/src/http_request_handler.cpp:672
#: trip-server-common/src/http_request_handler.cpp:682
msgid "Username"
msgstr "Username"

#. Shows how many database connections are being created for the application
#: trip-server-common/src/pg_pool.cpp:43
#: trip-server-common/src/pg_pool.cpp:44
msgid "Creating database pool with {1} connection"
msgid_plural "Creating database pool with {1} connections"
msgstr[0] "Creating database pool with {1} connection"
Expand Down
41 changes: 24 additions & 17 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: trip 2.0.0\n"
"Report-Msgid-Bugs-To: Frank Dean <frank.dean@fdsd.co.uk>\n"
"POT-Creation-Date: 2023-11-20 15:52+0000\n"
"PO-Revision-Date: 2023-06-02 11:29+0100\n"
"POT-Creation-Date: 2023-11-24 14:41+0000\n"
"PO-Revision-Date: 2023-11-22 17:00+0000\n"
"Last-Translator: Frank Dean <frank@fdsd.co.uk>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
"Language: es\n"
Expand Down Expand Up @@ -105,8 +105,8 @@ msgstr ""

#. Label for input new password for a user
#: src/admin_user_edit_handler.cpp:85
#: trip-server-common/src/http_request_handler.cpp:686
#: trip-server-common/src/http_request_handler.cpp:696
#: trip-server-common/src/http_request_handler.cpp:694
#: trip-server-common/src/http_request_handler.cpp:704
msgid "Password"
msgstr "Contraseña"

Expand Down Expand Up @@ -1264,42 +1264,42 @@ msgstr ""
msgid "OsmAnd color"
msgstr ""

#: src/main.cpp:106
#: src/main.cpp:107
msgid "The database is not ready for use. Cannot find the \"{1}\" table."
msgstr ""

#. Message output when the database is being upgraded
#: src/main.cpp:113
#: src/main.cpp:114
msgid "Upgrading the database"
msgstr "Acutaliza el base de datos"

#. Label for the version text of the application
#: src/main.cpp:125
#: src/main.cpp:127
msgid "version"
msgstr "versión"

#. Label for the web address the application is listening at
#: src/main.cpp:127
#: src/main.cpp:129
msgid "listening at"
msgstr "está escuchando en"

#. Output when the application has been built to allow serving static files.
#: src/main.cpp:133
#: src/main.cpp:135
msgid "The application has been built to serve static files."
msgstr "La aplicación ha sido construida para servir los archivos estáticos."

#. Displays the name of the directory that static files will be served from.
#: src/main.cpp:137
#: src/main.cpp:139
msgid "Static files will be served from the {1} directory."
msgstr "Archivos estático se servirá de la carpeta {1}"

#. Message showing how long the application took to startup in milliseconds
#: src/main.cpp:155
#: src/main.cpp:157
msgid "Started application in {1} ms"
msgstr "La aplicación se inició en {1} ms"

#. Text displayed when the application ends
#: src/main.cpp:161
#: src/main.cpp:163
msgid "Bye!"
msgstr "¡Adiós!"

Expand Down Expand Up @@ -1868,7 +1868,7 @@ msgstr ""

#. Title for the login page
#: src/trip_request_handler.cpp:74
#: trip-server-common/src/http_request_handler.cpp:708
#: trip-server-common/src/http_request_handler.cpp:716
msgid "Login"
msgstr "Login"

Expand Down Expand Up @@ -1922,20 +1922,27 @@ msgstr "Nombre de archivo de configuración no especificado\n"
msgid "Reading configuration from {1}"
msgstr "Está leyendo de configuración desde {1} "

#. Shows how many worker processes are still running when the application is stopping
#: trip-server-common/src/application.cpp:148
msgid "Stopping {1} worker"
msgid_plural "Stopping {1} workers"
msgstr[0] "Está parando {1} trabajador"
msgstr[1] "Está parando {1} trabajadores"

#. Shows how many worker processes are being created for the application
#: trip-server-common/src/application.cpp:160
#: trip-server-common/src/application.cpp:177
msgid "Creating {1} worker"
msgid_plural "Creating {1} workers"
msgstr[0] "Está creando {1} trabajador"
msgstr[1] "Está creando {1} trabajadores"

#: trip-server-common/src/http_request_handler.cpp:664
#: trip-server-common/src/http_request_handler.cpp:674
#: trip-server-common/src/http_request_handler.cpp:672
#: trip-server-common/src/http_request_handler.cpp:682
msgid "Username"
msgstr "Identificación del usuario"

#. Shows how many database connections are being created for the application
#: trip-server-common/src/pg_pool.cpp:43
#: trip-server-common/src/pg_pool.cpp:44
msgid "Creating database pool with {1} connection"
msgid_plural "Creating database pool with {1} connections"
msgstr[0] "Está creando un grupo de base de datos con {1} conexión"
Expand Down
Loading

0 comments on commit 387e135

Please sign in to comment.