Skip to content

Extra options per connection endpoint are ignored #730

@msfstef

Description

@msfstef

Elixir version

1.18.1

Database and Version

17

Postgrex Version

0.19.0

Current behavior

Specifying the start_link connection options as:

endpoints: [
        {hostname, port, socket_options: [:inet6]},
        {hostname, port, socket_options: [:inet]}
]

Results in a warning

[warning] Returning a triplet from :endpoints is deprecated, the server name indicator is automatically set based on the hostname if SSL is enabled

And the options are not respected - and looking at the source they seem to be completely discarded:

{hostname, port, _extra_opts} ->
Logger.warning(
"Returning a triplet from :endpoints is deprecated, " <>
"the server name indicator is automatically set based on the hostname if SSL is enabled"
)

Expected behavior

We want to be able to fallback from IPv6 to IPv4, and potentially also try different SSL options, and the endpoints option is currently documented to accept extra options.

If the library had the documented behaviour it would be very convenient for implementing fallbacks in configuration options - is the lack of support of options per endpoint an intentional decision, and would it potentially be reinstated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions