npgsql icon indicating copy to clipboard operation
npgsql copied to clipboard

NpgsqlConnection.ConnectionString parsing fails for IPv6 hosts

Open Brar opened this issue 3 years ago • 4 comments

This was broken by changes introduced with the multiple hosts feature.

Brar avatar Jun 02 '21 13:06 Brar

The ConnectionString_Host tests are failing on my local machine (and the test case for 127.0.0.1,127.0.0.1:5432,::1,[::1],[::1]:5432,localhost,localhost:5432 even hangs...).

@Brar @vonzshik are you not seeing this on your machines? Interesting that this isn't happening on CI either...

roji avatar Jun 11 '21 11:06 roji

No, it worked after the fixes from @vonzshik

Brar avatar Jun 11 '21 11:06 Brar

@roji everything's green on my end...

vonzshik avatar Jun 11 '21 12:06 vonzshik

I've temporarily disabled the test in #3824, will revisit this later to investigate what's special about my setup...

roji avatar Jun 11 '21 19:06 roji

Couldn't reproduce any issues with this test, reenabling in #4703.

roji avatar Oct 10 '22 09:10 roji

Ran into this again and figured it out... My postgresql.conf didn't have listen_addresses set, which means it defaults to localhost; apparently in some way that means that PG doesn't listen on IPv6, so test cases for e.g. ::1 failed with "connection refused". For multi-host cases, this failure caused the open attempt to hang indefinitely on the non-IPv6 option in the connection string (waiting for someone to close a connection).

Will look into making this test check pure parsing and not having it depend on environment configuration etc.

roji avatar Oct 31 '22 10:10 roji