]> granicus.if.org Git - pgbouncer/log
pgbouncer
5 years agoTravis CI: Remove redundant configuration
Peter Eisentraut [Thu, 19 Sep 2019 08:34:35 +0000 (10:34 +0200)]
Travis CI: Remove redundant configuration

Remove --with-openssl variant, since it's the default.

5 years agoFix reporting of adns implementation in configure
Peter Eisentraut [Wed, 18 Sep 2019 07:56:37 +0000 (09:56 +0200)]
Fix reporting of adns implementation in configure

This was slightly broken by 748c83e5d8b05448725ce8a69213ed620a53d431
in the sense that configure would report both, say, c-ares and evdns
as "yes" without indication which one would actually be used.  Clean
that logic up a bit and report the actually used implementation at the
end of configure in a clearer way.  Also improve the documentation in
README.md around this.

Also clean up the build matrix in .travis.yml and remove a redundant
configuration.

5 years agoAutomatically generate debian/changelog
Peter Eisentraut [Sat, 14 Sep 2019 07:03:57 +0000 (09:03 +0200)]
Automatically generate debian/changelog

This avoids another manual step during tarball wrapping.

5 years agoAppVeyor: Build on Windows with -Werror
Peter Eisentraut [Fri, 13 Sep 2019 08:31:24 +0000 (10:31 +0200)]
AppVeyor: Build on Windows with -Werror

5 years agoBump libusual
Peter Eisentraut [Fri, 13 Sep 2019 07:52:11 +0000 (09:52 +0200)]
Bump libusual

5 years agoTravis CI: Use correct apt repository
Peter Eisentraut [Thu, 12 Sep 2019 21:17:43 +0000 (23:17 +0200)]
Travis CI: Use correct apt repository

Change from xenial-pgdg to bionic-pgdg.

5 years agoFix some compiler warnings on Windows 64-bit
Peter Eisentraut [Thu, 12 Sep 2019 18:47:21 +0000 (20:47 +0200)]
Fix some compiler warnings on Windows 64-bit

For event_set() callbacks, use evutil_socket_t instead of int as the
first argument.  This is required for 64-bit Windows; on all other
platforms, the two types are the same.

This requires libevent version 2.

Note that the rest of the socket code still uses int everywhere, so
Windows 64-bit is still probably not going to work correctly.

5 years agoRemove use of libusual event module
Peter Eisentraut [Wed, 11 Sep 2019 08:20:27 +0000 (10:20 +0200)]
Remove use of libusual event module

We use libevent directly now and use pkg-config to look it up.

The libusual event module was from a time when libevent was new and
evolving, but now we don't need it anymore and can use libevent
directly.

5 years agoRemove dubious const qualifiers
Peter Eisentraut [Wed, 11 Sep 2019 10:48:27 +0000 (12:48 +0200)]
Remove dubious const qualifiers

These depend on libusual's redefinition of free(), which we should get
rid of.

see #371

5 years agoRemove support for libevent version 1.x
Peter Eisentraut [Wed, 11 Sep 2019 09:38:57 +0000 (11:38 +0200)]
Remove support for libevent version 1.x

This is long obsolete and stands in the way of some future
improvements.

5 years agoRemove broken assertions
Peter Eisentraut [Wed, 11 Sep 2019 08:28:55 +0000 (10:28 +0200)]
Remove broken assertions

These haven't worked since 035b15e3707bb295142830a27ac36f6997cb3861.

5 years agoFix issue with PAM users losing their password
Peter Eisentraut [Tue, 10 Sep 2019 19:26:41 +0000 (21:26 +0200)]
Fix issue with PAM users losing their password

The normal flow when starting a client connection is that set_pool()
is called with an empty password ("").  For normal users, the password
was already set earlier from auth_file or auth_query, so this empty
password is ignored.  For PAM users, the empty password is stored but
the real password is set later when authentication is complete.

The problem in the PAM case is that for the next client connection,
this would overwrite the stored password with an empty password until
the real password would then be re-added later.  If the client
authentication doesn't complete for whatever reason (perhaps server is
down and fast-fail is active), then the correct password is never set.
This would then have clobbered the user's password that might be
useful for server authentication.  There are probably other failure
scenarios.

To fix, call set_pool() with a NULL password instead, and teach
add_pam_user() not to overwrite an existing password if the argument
is NULL.

reported, analysis, and fix proposal by @achix

fixes #285

5 years agoRemove no longer used macro
Peter Eisentraut [Mon, 9 Sep 2019 17:42:29 +0000 (19:42 +0200)]
Remove no longer used macro

5 years agoSend stats columns as numeric instead of bigint
Peter Eisentraut [Mon, 9 Sep 2019 16:56:50 +0000 (18:56 +0200)]
Send stats columns as numeric instead of bigint

Internally, most statistiscs are kept as uint64_t.  Sending those
with a row descriptor that claims they are bigint can lead to problems
if uint64_t values can overflow the signed 64-bit integer range.  Then
a client library that wants to convert the value to its locally
appropriate signed 64-bit integer type would run into errors.

based on patch by @stanhu

fixes #360 #401

5 years agoRemove references to PostgreSQL wiki
Peter Eisentraut [Thu, 29 Aug 2019 19:39:16 +0000 (21:39 +0200)]
Remove references to PostgreSQL wiki

The information is now all on the PgBouncer web site.

5 years agoAdd make check target
Peter Eisentraut [Thu, 29 Aug 2019 07:17:11 +0000 (09:17 +0200)]
Add make check target

This is a standard way to run all tests.

5 years agoTravis CI: Update to bionic instead of xenial
Peter Eisentraut [Wed, 28 Aug 2019 19:04:09 +0000 (21:04 +0200)]
Travis CI: Update to bionic instead of xenial

Enable OpenSSL for Valgrind run, since it should work now (see
66b6dc2c31f7360e11347b20216c6c7ec5ce13cf).

Disable ElectricFence, seems broken:
<https://answers.launchpad.net/ubuntu/+question/674132>

Enable -Werror for c-ares build.  Warning about broken IPv6 support
should be gone now.

5 years agoTravis CI: Shell fix
Peter Eisentraut [Tue, 27 Aug 2019 20:22:24 +0000 (22:22 +0200)]
Travis CI: Shell fix

Newer cd versions apparently complain about too many arguments, which
was a problem here, since pgbouncer-* expands to both the directory
name and the tarball name.

5 years agodnslookup: Improve warning message phrasing
Peter Eisentraut [Wed, 28 Aug 2019 10:55:40 +0000 (12:55 +0200)]
dnslookup: Improve warning message phrasing

5 years agodnslookup: Fix compiler warnings from unused functions
Peter Eisentraut [Wed, 28 Aug 2019 10:00:11 +0000 (12:00 +0200)]
dnslookup: Fix compiler warnings from unused functions

5 years agov1.11.0 pgbouncer_1_11_0
Peter Eisentraut [Tue, 27 Aug 2019 08:17:07 +0000 (10:17 +0200)]
v1.11.0

5 years agoAdd simple test for all SHOW commands
Peter Eisentraut [Fri, 23 Aug 2019 07:14:33 +0000 (09:14 +0200)]
Add simple test for all SHOW commands

5 years agoAdd SASL and SCRAM support
Peter Eisentraut [Sun, 18 Aug 2019 04:56:14 +0000 (06:56 +0200)]
Add SASL and SCRAM support

Add support for SASL/SCRAM-SHA-256 authentication for clients and servers.

Import a few files from PostgreSQL core (commit REL_11_5) to support
SCRAM.

resolves #208

5 years agoRecognize GSSENCRequest packet
Peter Eisentraut [Fri, 16 Aug 2019 10:56:50 +0000 (12:56 +0200)]
Recognize GSSENCRequest packet

This is a new startup packet type introduced in PostgreSQL 12.  In
PgBouncer, we'll for now reject GSS encryption attempts.

Without this, PgBouncer would reject such connections with "bad packet
header" errors, requiring the client to reconnect before being able to
do the normal startup.

5 years agoBump libusual
Peter Eisentraut [Sat, 17 Aug 2019 09:38:32 +0000 (11:38 +0200)]
Bump libusual

5 years agotest: Restart pgbouncer for every test
Peter Eisentraut [Thu, 15 Aug 2019 07:33:44 +0000 (09:33 +0200)]
test: Restart pgbouncer for every test

There are too many cases where existing pool states lingers between
one test and another, making some test results unreliable.  It's safer
to just restart the whole process to get a clean start.

This also lets us mark the pgbouncer log file with where a test began
and ended.

5 years agoTest against multiple PostgreSQL versions
Peter Eisentraut [Tue, 13 Aug 2019 00:12:54 +0000 (02:12 +0200)]
Test against multiple PostgreSQL versions

This allows testing versions with older and newer authentication
behavior.

5 years agoDisable PAM for Valgrind build
Peter Eisentraut [Tue, 13 Aug 2019 06:19:54 +0000 (08:19 +0200)]
Disable PAM for Valgrind build

It creates mysterious errors that I don't want to deal with right now.

5 years agoMore useful Valgrind options
Peter Eisentraut [Tue, 13 Aug 2019 00:14:44 +0000 (02:14 +0200)]
More useful Valgrind options

Make sure leaks actually result in an error report.

Remove --read-var-info=yes since it causes problems on some systems.

5 years agoAdd tests for taking password from auth_file
Peter Eisentraut [Sun, 11 Aug 2019 19:51:25 +0000 (21:51 +0200)]
Add tests for taking password from auth_file

5 years agoAdd test for md5 authentication with plain-text password stored
Peter Eisentraut [Sun, 11 Aug 2019 16:32:46 +0000 (18:32 +0200)]
Add test for md5 authentication with plain-text password stored

Now we have tests for all four combinations of plain-text and md5
passwords and plain and md5 authentication.

5 years agoClean up example and test configuration files
Peter Eisentraut [Fri, 9 Aug 2019 11:29:50 +0000 (13:29 +0200)]
Clean up example and test configuration files

Consistently comment out settings that are the default, update various
documentation comments, make commenting consistent.

In configuration files for tests, remove most comments, so we don't
have to keep syncing them with the main example file.

5 years agodoc: Update link to pg_hba.conf documentation
Peter Eisentraut [Fri, 9 Aug 2019 11:05:29 +0000 (13:05 +0200)]
doc: Update link to pg_hba.conf documentation

Also rephrase the text a bit so that it doesn't need to be updated for
every authentication method change in PostgreSQL or PgBouncer.

5 years agoREADME: Wording improvements
Peter Eisentraut [Tue, 6 Aug 2019 08:01:39 +0000 (10:01 +0200)]
README: Wording improvements

5 years agoAdd AppVeyor configuration for Windows
Peter Eisentraut [Mon, 5 Aug 2019 19:48:00 +0000 (21:48 +0200)]
Add AppVeyor configuration for Windows

5 years agoTravis CI: Add test run with Valgrind
Peter Eisentraut [Mon, 5 Aug 2019 07:23:28 +0000 (09:23 +0200)]
Travis CI: Add test run with Valgrind

Note: Valgrind on Ubuntu xenial is broken for OpenSSL[0], so don't
configure that right now.  Travis CI on bionic still has issues[1], so
we're stuck here for now.

[0]: https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1574437
[1]: https://travis-ci.community/t/apt-addon-doesnt-run-in-bionic/4061

5 years agoUpdate sample pgbouncer.ini for log_stats addition
Peter Eisentraut [Sun, 4 Aug 2019 01:10:13 +0000 (03:10 +0200)]
Update sample pgbouncer.ini for log_stats addition

5 years agoAdd option to disable printing stats to log
Peter Eisentraut [Sat, 3 Aug 2019 21:24:36 +0000 (23:24 +0200)]
Add option to disable printing stats to log

Add option log_stats that can be used to disable printing stats to
log.  Stats are still updated every stats_period, for SHOW commands.

Author: @weastur

fixes #287

5 years agoHandle auth_type=password when the stored password is md5
Peter Eisentraut [Sat, 3 Aug 2019 15:38:27 +0000 (17:38 +0200)]
Handle auth_type=password when the stored password is md5

This matches what a PostgreSQL server would do.

Author: @hashbrowncipher

fixes #129

5 years agoAdd tests for plain-text password authentication
Peter Eisentraut [Sat, 3 Aug 2019 15:32:30 +0000 (17:32 +0200)]
Add tests for plain-text password authentication

5 years agoAdd [users] section to example config file
Peter Eisentraut [Sat, 3 Aug 2019 11:51:02 +0000 (13:51 +0200)]
Add [users] section to example config file

Also add some missing documentation about the [users] section.

Reported-by: @brunomgalmeida
fixes #330

5 years agoFix typo
Peter Eisentraut [Sat, 3 Aug 2019 07:39:30 +0000 (09:39 +0200)]
Fix typo

5 years agoSubstitute version into man pages automatically
Peter Eisentraut [Fri, 2 Aug 2019 06:36:02 +0000 (08:36 +0200)]
Substitute version into man pages automatically

5 years agotest: Add -w option to pg_ctl invocation
Peter Eisentraut [Fri, 2 Aug 2019 07:00:39 +0000 (09:00 +0200)]
test: Add -w option to pg_ctl invocation

This is the default in recent PostgreSQL versions.  This change just
makes the script behavior consistent across versions.  We can now also
remove some sleep calls to make the tests start faster.

5 years agoReorganize AUTH_* symbols
Peter Eisentraut [Fri, 2 Aug 2019 05:38:20 +0000 (07:38 +0200)]
Reorganize AUTH_* symbols

Separate numerically into protocol codes and internal codes.  This
makes room for protocol codes currently not supported.

5 years agoTravis CI: Add test run with ElectricFence
Peter Eisentraut [Fri, 2 Aug 2019 05:40:37 +0000 (07:40 +0200)]
Travis CI: Add test run with ElectricFence

5 years agoTweak test timing to make it more stable
Peter Eisentraut [Fri, 2 Aug 2019 05:00:18 +0000 (07:00 +0200)]
Tweak test timing to make it more stable

5 years agoconfigure.ac: Update AC_INIT invocation
Peter Eisentraut [Fri, 2 Aug 2019 06:50:32 +0000 (08:50 +0200)]
configure.ac: Update AC_INIT invocation

Add bug report and URL information, update PgBouncer capitalization.

5 years agoImprove debug message
Peter Eisentraut [Fri, 2 Aug 2019 06:26:24 +0000 (08:26 +0200)]
Improve debug message

5 years agoFix debug messag
Peter Eisentraut [Fri, 2 Aug 2019 06:15:40 +0000 (08:15 +0200)]
Fix debug messag

It was using an uninitialized variable.

5 years agoTravis CI: Also run ssl tests
Peter Eisentraut [Thu, 1 Aug 2019 14:33:56 +0000 (16:33 +0200)]
Travis CI: Also run ssl tests

5 years agoSync ssl/test.sh with test.sh
Peter Eisentraut [Thu, 1 Aug 2019 19:24:57 +0000 (21:24 +0200)]
Sync ssl/test.sh with test.sh

Make locations for logs and pid files consistent.

5 years agoRemove ssl test data from git
Peter Eisentraut [Thu, 1 Aug 2019 15:42:00 +0000 (17:42 +0200)]
Remove ssl test data from git

The test script deletes it anyway before use, so it's of no use here.

5 years agoAdd tests for md5 authentication
Peter Eisentraut [Thu, 1 Aug 2019 15:57:57 +0000 (17:57 +0200)]
Add tests for md5 authentication

5 years agoFix shell syntax in test suite
Peter Eisentraut [Thu, 1 Aug 2019 15:59:40 +0000 (17:59 +0200)]
Fix shell syntax in test suite

Using return outside a function doesn't make sense.

5 years agoAdd some debugging for failed tests
Peter Eisentraut [Thu, 1 Aug 2019 08:00:12 +0000 (10:00 +0200)]
Add some debugging for failed tests

Print the log file of the failed test if the test fails.  This helps
analyzing failures when run in a CI environment.

5 years agoTravis CI: Run tests as part of build
Peter Eisentraut [Wed, 31 Jul 2019 20:17:45 +0000 (22:17 +0200)]
Travis CI: Run tests as part of build

This required a fair amount of tweaking to get the tests stable
enough, but it seems good now.

5 years agoTweak some test timing to make the tests more stable
Peter Eisentraut [Thu, 1 Aug 2019 12:02:21 +0000 (14:02 +0200)]
Tweak some test timing to make the tests more stable

5 years agoRewrite test_server_connect_timeout_establish using pre_auth_delay
Peter Eisentraut [Thu, 1 Aug 2019 07:03:28 +0000 (09:03 +0200)]
Rewrite test_server_connect_timeout_establish using pre_auth_delay

This avoids having to deal with strange behaviors and portability
issues from netcat.

Since ALTER SYSTEM is being used, this now requires at least
PostgreSQL 9.4 for the test.

5 years agoFix wait time computation with auth_user
Peter Eisentraut [Wed, 31 Jul 2019 11:51:44 +0000 (13:51 +0200)]
Fix wait time computation with auth_user

When using auth_user, the transition to the CL_WAITING_LOGIN state
would not initialize the client->wait_start field.  This would either
lead to garbage values being recorded, or under assertions enabled it
would crash in activate_client().

(test_auth_user was actually reproducing this problem, but a crash
requires assertions enabled and new memory being all zero, so it was
difficult to catch it.)

Author: @pinaraf

see #393

5 years agov1.10.0 pgbouncer_1_10_0
Peter Eisentraut [Mon, 1 Jul 2019 07:02:10 +0000 (09:02 +0200)]
v1.10.0

5 years agoBump libusual
Peter Eisentraut [Fri, 28 Jun 2019 07:06:57 +0000 (09:06 +0200)]
Bump libusual

5 years agoRewrite man page filter to work independent of Pandoc
Peter Eisentraut [Sat, 29 Jun 2019 13:47:43 +0000 (15:47 +0200)]
Rewrite man page filter to work independent of Pandoc

This allows it to work with really old Pandoc versions that don't have
the --filter option (e.g., on CentOS 6).  This just makes it a plain
text-munging filter script.

5 years agoMake stress.py compatible with Python 3
Peter Eisentraut [Wed, 26 Jun 2019 21:28:06 +0000 (23:28 +0200)]
Make stress.py compatible with Python 3

5 years agoDo not depend on Pandoc 2.0
Marco Nenciarini [Wed, 26 Jun 2019 13:38:48 +0000 (15:38 +0200)]
Do not depend on Pandoc 2.0

Replace the Lua filter with one written in Python, so it can work with
older Pandoc versions.  Import pandocfilters.py package from Pandoc to
help with that.

5 years agoImprove pid file processing
Peter Eisentraut [Mon, 24 Jun 2019 20:46:10 +0000 (22:46 +0200)]
Improve pid file processing

Remove some useless code that triggers a TOCTOU warning from
Coverity.  Make error messages more accurate.

5 years agoAdd support for TLSv1.3 enabling and disabling
Peter Eisentraut [Mon, 24 Jun 2019 20:23:19 +0000 (22:23 +0200)]
Add support for TLSv1.3 enabling and disabling

It already worked automatically; this just adds the options to enable
and disable the protocol version explicitly.

5 years agoAdd missing options TOTALS and USERS
Peter Eisentraut [Mon, 24 Jun 2019 20:16:01 +0000 (22:16 +0200)]
Add missing options TOTALS and USERS

These were not included in the output of SHOW HELP.

Author: @davidfetter

fixes #388

5 years agoFix usage typo
Gabe Gorelick [Fri, 8 Feb 2019 21:33:40 +0000 (15:33 -0600)]
Fix usage typo

a online restart -> an online restart

5 years agoImprove error message
Peter Eisentraut [Mon, 24 Jun 2019 19:58:37 +0000 (21:58 +0200)]
Improve error message

5 years agoFix idle_transaction_timeout calculation
Peter Eisentraut [Mon, 24 Jun 2019 14:46:45 +0000 (16:46 +0200)]
Fix idle_transaction_timeout calculation

idle_transaction_timeout should count from the last request of the
server, because the server sent the idle information.  The code
previously used the last request of the client, which could lead to
premature timeouts.

fixes #125

5 years agoMake error messages more precise
Peter Eisentraut [Mon, 24 Jun 2019 14:25:25 +0000 (16:25 +0200)]
Make error messages more precise

5 years agoTweak some debug messages for clarity
Peter Eisentraut [Mon, 24 Jun 2019 14:22:18 +0000 (16:22 +0200)]
Tweak some debug messages for clarity

5 years agodoc: Document remaining SHOW commands
Peter Eisentraut [Mon, 24 Jun 2019 14:18:54 +0000 (16:18 +0200)]
doc: Document remaining SHOW commands

Some of these present internal information that we don't want to
document fully, but at least mentioning them for completeness seems
reasonable.

fixes #394

5 years agodoc: Various cosmetic improvements
Peter Eisentraut [Thu, 20 Jun 2019 14:02:52 +0000 (16:02 +0200)]
doc: Various cosmetic improvements

5 years agoAdd documentation for available test suites
Peter Eisentraut [Wed, 19 Jun 2019 15:19:28 +0000 (17:19 +0200)]
Add documentation for available test suites

fixes #83

5 years agopycodestyle (PEP8) pass over Python scripts
Peter Eisentraut [Wed, 19 Jun 2019 15:11:41 +0000 (17:11 +0200)]
pycodestyle (PEP8) pass over Python scripts

5 years agostress.py: Convert to psycopg2
Peter Eisentraut [Wed, 19 Jun 2019 14:36:18 +0000 (16:36 +0200)]
stress.py: Convert to psycopg2

It was still on the ancient psycopg module.

5 years agostress.py: Update port number in test script
Peter Eisentraut [Wed, 19 Jun 2019 14:35:43 +0000 (16:35 +0200)]
stress.py: Update port number in test script

from 6000 to 6432

5 years agoConvert documentation from rst to Markdown
Peter Eisentraut [Thu, 7 Feb 2019 12:47:56 +0000 (13:47 +0100)]
Convert documentation from rst to Markdown

It seems that many contributors already submit patches thinking that
rst is Markdown, which leads to incorrect and inconsistent formatting,
since the two are similar but not compatible.  By using the more well
known Markdown, we can perhaps hope to achieve better formatted
documentation contributions.

Also, since the web site uses Markdown as its source format, by using
Markdown here we can avoid the fragile conversion process altogether.

5 years agoRemove outdated auth_file documentation
Peter Eisentraut [Wed, 6 Feb 2019 21:07:42 +0000 (22:07 +0100)]
Remove outdated auth_file documentation

Once upon a time, one could point auth_file to pg_auth in the
PostgreSQL data directory, but this is long obsolete (gone as of
PostgreSQL 9.0), so remove mentions of it.

5 years agoPrevent too long user name or password from client
Peter Eisentraut [Tue, 5 Feb 2019 21:52:19 +0000 (22:52 +0100)]
Prevent too long user name or password from client

In most cases, this wouldn't work anyway, because for example the user
wouldn't be found in pgbouncer, since userlist.txt doesn't permit too
long user names.  But in the case of PAM there was no such check, so
too long user names could be added by add_pam_user(), which would
truncate them, and then a subsequent search using the not-truncated
name wouldn't find it, causing duplicates to be added.

Reported-by: @achix
fixes #353

5 years agoMerge pull request #356 from mnencia/issue-220
Petr Jelinek [Sun, 30 Dec 2018 18:35:18 +0000 (19:35 +0100)]
Merge pull request #356 from mnencia/issue-220

Avoid 'unexpected response from login query' after a postgres reload

5 years agoAvoid 'unexpected response from login query' after a postgres reload
Marco Nenciarini [Fri, 28 Dec 2018 19:06:58 +0000 (20:06 +0100)]
Avoid 'unexpected response from login query' after a postgres reload

After a PostgreSQL reload, the backend could inform the frontend about
configuration changes by sending some ParameterStatus messages
together with the usual login query response. These messages can be
safely ignored in the login query response handler.

Closes: #220
6 years agoMove comment to the right place
Peter Eisentraut [Mon, 3 Dec 2018 15:08:05 +0000 (16:08 +0100)]
Move comment to the right place

6 years agoPut units on log message
Peter Eisentraut [Fri, 23 Nov 2018 07:29:38 +0000 (08:29 +0100)]
Put units on log message

age=N -> age=Ns

6 years agoMerge pull request #329 from marcocitus/cancellations_fix
Petr Jelinek [Fri, 9 Nov 2018 15:34:31 +0000 (16:34 +0100)]
Merge pull request #329 from marcocitus/cancellations_fix

Do not wait server_login_retry for next connect if cancellation succeeds

6 years agoDo not wait server_login_retry for next connect if cancellation succeeds
Marco Slot [Tue, 25 Sep 2018 10:10:52 +0000 (10:10 +0000)]
Do not wait server_login_retry for next connect if cancellation succeeds

If postgres restarts while there are N cancellations in the queue,
pgbouncer is currently unavailable for at least N*server_login_retry
because it uses every new connection for one queued cancellation and
then waits server_login_retry before opening a new connection because
the last_connect_failed flag is still set to 1. This can lead to
prolonged downtime.

This changes fixes the issue by introducing a last_login_failed flag.
The last_connect_failed is now reset when a cancellation succeeds, such
that launch_new_connection no longer waits if pgbouncer manages to
connect, but has queued cancellations. The last_login_failed flag has
the same semantics as the last_connect_failed flag had previously, such
that check_fast_fail still rejects connections when there are no servers
available and the last login failed.

6 years agoAdd exit status to test scripts
Peter Eisentraut [Fri, 21 Sep 2018 13:35:00 +0000 (15:35 +0200)]
Add exit status to test scripts

When a test fails, exit with status 1, so automation can catch test
failures.  Also add a way to skip tests that cannot be run (mainly for
lack of sudo in this case).

6 years agoFix rare crash
Peter Eisentraut [Tue, 11 Sep 2018 10:30:53 +0000 (12:30 +0200)]
Fix rare crash

SHOW FDS could in rare cases crash if a client had not been assigned
to a pool yet, causing a null pointer dereference.

fixes #311

6 years agodoc: Update SHOW DATABASES documentation
Peter Eisentraut [Mon, 10 Sep 2018 08:32:00 +0000 (10:32 +0200)]
doc: Update SHOW DATABASES documentation

Documentation of reserve_pool was missing.

fixes #322

6 years agoFix typos
Peter Eisentraut [Mon, 10 Sep 2018 08:31:18 +0000 (10:31 +0200)]
Fix typos

fixes #322

6 years agoClarify file descriptor use log message
Peter Eisentraut [Mon, 10 Sep 2018 08:01:32 +0000 (10:01 +0200)]
Clarify file descriptor use log message

6 years agoMake sure file descriptor info goes to the log
Peter Eisentraut [Tue, 21 Aug 2018 19:55:33 +0000 (21:55 +0200)]
Make sure file descriptor info goes to the log

Delay the call to check_limits() until after daemonization so that the
message goes to the server log and is not printed to some other output
location.

6 years agoFix rst syntax
Peter Eisentraut [Mon, 20 Aug 2018 17:48:45 +0000 (19:48 +0200)]
Fix rst syntax

6 years agoImprove shell script portability
Peter Eisentraut [Sat, 18 Aug 2018 20:11:43 +0000 (22:11 +0200)]
Improve shell script portability

Use printf instead of echo -n, for BSD compatibility, similar to
1b6db6c506cbed67fb4012a1217898a4b8e35252.

6 years agoFix psql invocation in tests
Peter Eisentraut [Sat, 18 Aug 2018 20:10:42 +0000 (22:10 +0200)]
Fix psql invocation in tests

similar to 4f48ae3c7c7a3ae7aab4594420b0646ae27d4c7d, but for the ssl
tests

6 years agoFix up conntest test programs
Peter Eisentraut [Fri, 17 Aug 2018 19:50:04 +0000 (21:50 +0200)]
Fix up conntest test programs

Allow asynctest to run without an explicitly specified connection
string.  That way it can pick up the connection parameters from the
environment.  The run-conntest.sh driver script was already calling it
that way.

Fix the location of the pgbouncer binary in run-conntest.sh.

6 years agoImprove test script robustness
Peter Eisentraut [Thu, 16 Aug 2018 19:10:47 +0000 (21:10 +0200)]
Improve test script robustness

Consistently exit with an error if the OS is not supported by the
firewall manipulation commands.  Previously, it would in some cases
print an error but not exit.

6 years agoFix typo in test script
Peter Eisentraut [Wed, 15 Aug 2018 21:11:56 +0000 (23:11 +0200)]
Fix typo in test script