pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: joe.zhou@dualhelios.com
Subject: Mismatch for connection key/value pair  between documentation  and code?
Date: Tue, 16 Jul 2024 04:54:53 +0000
Message-ID: <172110569327.736585.18068265437149291546@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/libpq-connect.html
Description:

Hi PostgreSQL documentation team, 

I have a confusion regarding parameters used   in documentation vs. that in
the code. Please clarify if I misunderstand something there or.

Thanks,
Joe


For the following document regarding connect string, it is not aligned with
the code.
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

e.g. Timeout for connection

In the above document,it states the following:

"connect_timeout 
Maximum time to wait while connecting, in seconds (write as a decimal
integer, e.g., 10). Zero, negative, or not specified means wait
indefinitely. The minimum allowed timeout is 2 seconds, therefore a value of
1 is interpreted as 2. This timeout applies separately to each host name or
IP address. For example, if you specify two hosts and connect_timeout is 5,
each host will time out if no connection is made within 5 seconds, so the
total time spent waiting for a connection might be up to 10 seconds."


However in the code:
https://github.com/npgsql/npgsql/blob/docs/src/Npgsql/NpgsqlConnectionStringBuilder.cs,
starting L789  to L812 (latest version when I raise this ticket).

The name is Timeout instead of connect_timeout, and there's no logic
regarding 2 second check


    /// <summary>
    /// The time to wait (in seconds) while trying to establish a connection
before terminating the attempt and generating an error.
    /// Defaults to 15 seconds.
    /// </summary>
    [Category("Timeouts")]
    [Description("The time to wait (in seconds) while trying to establish a
connection before terminating the attempt and generating an error.")]
    [DisplayName("Timeout")]
    [NpgsqlConnectionStringProperty]
    [DefaultValue(DefaultTimeout)]
    public int Timeout
    {
        get => _timeout;
        set
        {
            if (value < 0 || value > NpgsqlConnection.TimeoutLimit)
                throw new ArgumentOutOfRangeException(nameof(value), value,
"Timeout must be between 0 and " + NpgsqlConnection.TimeoutLimit);

            _timeout = value;
            SetValue(nameof(Timeout), value);
        }
    }
    int _timeout;

    internal const int DefaultTimeout = 15;


view thread (3+ messages)  latest in thread

Message-ID: <172110569327.736585.18068265437149291546@wrigleys.postgresql.org>
Permalink:  ../172110569327.736585.18068265437149291546@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/172110569327.736585.18068265437149291546@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, joe.zhou@dualhelios.com
  Subject: Re: Mismatch for connection key/value pair  between documentation  and code?
  In-Reply-To: <172110569327.736585.18068265437149291546@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox