Mismatch for connection key/value pair between documentation and code? - Mailing list pgsql-docs

From PG Doc comments form
Subject Mismatch for connection key/value pair between documentation and code?
Date
Msg-id 172110569327.736585.18068265437149291546@wrigleys.postgresql.org
Whole thread Raw
Responses Re: Mismatch for connection key/value pair between documentation and code?
List pgsql-docs
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;

pgsql-docs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Add small detail to RAISE statement descripton
Next
From: PG Doc comments form
Date:
Subject: Change detail text in last example of 43.5.3. Executing a Command with a Single-Row Result