Repository navigation
Remove multiplexing - #6457
Remove multiplexing#6457
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the multiplexing feature from Npgsql and simplifies the implementation and test suite accordingly (per #6449, intended to merge after #6314).
Changes:
- Removes multiplexing implementation, configuration surface area, and related infrastructure (data source, connector I/O loops, binding scopes, counters, logging).
- Updates tests to run without
MultiplexingTestBase/MultiplexingModeand deletes multiplexing-only test cases/workarounds. - Updates public API tracking to reflect the removal of
NpgsqlConnectionStringBuilder.MultiplexingandWriteCoalescingBufferThresholdBytes.
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Npgsql.Tests/Types/TextTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/RecordTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/RangeTests.cs | Removes multiplexing workarounds; switches to TestBase. |
| test/Npgsql.Tests/Types/NumericTypeTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/NumericTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/NetworkTypeTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/MultirangeTests.cs | Removes multiplexing deadlock workaround (Task.Yield). |
| test/Npgsql.Tests/Types/MiscTypeTests.cs | Removes multiplexing skip/branching in tests; switches to TestBase. |
| test/Npgsql.Tests/Types/LegacyDateTimeTests.cs | Removes multiplexing-specific comment/import; remains non-parallelizable. |
| test/Npgsql.Tests/Types/LTreeTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/JsonTests.cs | Removes multiplexing fixtures and constructor parameter; keeps json/jsonb fixtures. |
| test/Npgsql.Tests/Types/JsonPathTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/JsonDynamicTests.cs | Removes multiplexing fixtures and constructor parameter; keeps json/jsonb fixtures. |
| test/Npgsql.Tests/Types/InternalTypeTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/HstoreTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/GeometricTypeTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/FullTextSearchTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/EnumTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/DomainTests.cs | Removes multiplexing ignore and switches to TestBase. |
| test/Npgsql.Tests/Types/DateTimeTests.cs | Removes multiplexing-specific comment. |
| test/Npgsql.Tests/Types/CubeTests.cs | Switches to TestBase and removes multiplexing ctor. |
| test/Npgsql.Tests/Types/CompositeTests.cs | Removes multiplexing-specific transaction workaround; updates comments. |
| test/Npgsql.Tests/Types/ByteaTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/BitStringTests.cs | Switches from multiplexing fixtures/base class to TestBase. |
| test/Npgsql.Tests/Types/ArrayTests.cs | Removes multiplexing ignores and switches to TestBase. |
| test/Npgsql.Tests/TransactionTests.cs | Removes multiplexing branches/ignores; switches to TestBase. |
| test/Npgsql.Tests/TracingTests.cs | Removes multiplexing fixture dimension; simplifies activity assertions to single mode. |
| test/Npgsql.Tests/TestUtil.cs | Removes Multiplexing=False from default test connection string. |
| test/Npgsql.Tests/Support/TestBase.cs | Removes multiplexing mentions and multiplexing-specific tx usage in type assertion helpers. |
| test/Npgsql.Tests/Support/MultiplexingTestBase.cs | Deleted multiplexing test base and MultiplexingMode enum. |
| test/Npgsql.Tests/Support/AssemblySetUp.cs | Removes Multiplexing=false from admin connection settings. |
| test/Npgsql.Tests/SecurityTests.cs | Removes multiplexing parameter dimension and related branching. |
| test/Npgsql.Tests/ReaderTests.cs | Removes multiplexing fixtures/branches/workarounds; simplifies ctor. |
| test/Npgsql.Tests/ReaderOldSchemaTests.cs | Removes commented multiplexing-specific guard. |
| test/Npgsql.Tests/ReaderNewSchemaTests.cs | Removes commented multiplexing ignore. |
| test/Npgsql.Tests/PrepareTests.cs | Removes multiplexing-not-supported test now that feature is removed. |
| test/Npgsql.Tests/PoolTests.cs | Removes multiplexing-only ignored test. |
| test/Npgsql.Tests/LoggingTests.cs | Removes multiplexing branching in logging assertions; switches to TestBase. |
| test/Npgsql.Tests/DataSourceTests.cs | Removes multiplexing dimension; removes multiplexing-specific regression test. |
| test/Npgsql.Tests/CopyTests.cs | Removes multiplexing ignores and updates comments; switches to TestBase. |
| test/Npgsql.Tests/ConnectionTests.cs | Removes multiplexing branches/ignores; switches to TestBase. |
| test/Npgsql.Tests/CommandTests.cs | Removes multiplexing branches/ignores; switches to TestBase. |
| test/Npgsql.Tests/CommandParameterTests.cs | Removes multiplexing branch for prepared parameter test; switches to TestBase. |
| test/Npgsql.Tests/BugTests.cs | Removes multiplexing-only regression test. |
| test/Npgsql.Tests/BatchTests.cs | Removes multiplexing fixture dimension; switches to TestBase. |
| test/Npgsql.Tests/AuthenticationTests.cs | Removes multiplexing-specific connection retry comment; switches to TestBase. |
| test/Npgsql.PluginTests/NodaTimeTests.cs | Switches from multiplexing test base to TestBase; removes multiplexing ctor. |
| src/Npgsql/Util/ManualResetValueTaskSource.cs | Deleted helper type used by multiplexing paths. |
| src/Npgsql/Replication/ReplicationConnection.cs | Removes multiplexing references and disables it implicitly by removal. |
| src/Npgsql/PublicAPI.Unshipped.txt | Marks multiplexing-related connection string builder properties as removed. |
| src/Npgsql/PoolingDataSource.cs | Removes multiplexing-specific asserts/comments around idle connectors and return path. |
| src/Npgsql/NpgsqlTransaction.cs | Removes transaction binding-scope unbinding (multiplexing-related). |
| src/Npgsql/NpgsqlSlimDataSourceBuilder.cs | Removes construction and validation logic for multiplexing data source. |
| src/Npgsql/NpgsqlSchema.cs | Removes temporary binding scope; uses bound connector directly for DataTypes schema. |
| src/Npgsql/NpgsqlRawCopyStream.cs | Removes binding-scope teardown (multiplexing-related). |
| src/Npgsql/NpgsqlMultiHostDataSource.cs | Removes multiplexing assertion in multi-host setup. |
| src/Npgsql/NpgsqlEventSource.cs | Removes multiplexing-specific counters and tracking. |
| src/Npgsql/NpgsqlEventId.cs | Leaves multiplexing-related event IDs but annotates them as removed feature. |
| src/Npgsql/NpgsqlDataReader.cs | Removes multiplexing-specific cleanup/unbinding behavior; simplifies send-task comment. |
| src/Npgsql/NpgsqlConnectionStringBuilder.cs | Removes Multiplexing and WriteCoalescingBufferThresholdBytes settings and validation. |
| src/Npgsql/NpgsqlConnection.cs | Removes connector binding scope infrastructure and multiplexing open/close paths. |
| src/Npgsql/NpgsqlCommand.cs | Removes multiplexing execution branch and related channel/value-task plumbing; simplifies query parsing. |
| src/Npgsql/NpgsqlBinaryImporter.cs | Removes binding-scope teardown (multiplexing-related). |
| src/Npgsql/NpgsqlBinaryExporter.cs | Removes binding-scope teardown (multiplexing-related). |
| src/Npgsql/MultiplexingDataSource.cs | Deleted multiplexing data source implementation. |
| src/Npgsql/LogMessages.cs | Removes multiplexing-specific log messages and event usage. |
| src/Npgsql/Internal/NpgsqlConnector.cs | Removes multiplexing I/O loops, command-in-flight tracking, and multiplexing-only restrictions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NinoFloris
left a comment
There was a problem hiding this comment.
It all looks good to me. Always possible the PR left some traces behind, but that's not really important to one shot either.
d0b9bf5 to
b602b7f
Compare
b602b7f to
452a3e4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [Test] | ||
| [IssueLink("https://github.com/npgsql/npgsql/issues/3248")] | ||
| // More at #3254 | ||
| public async Task Bug3248_Dispose_transaction_Rollback() | ||
| { | ||
| if (!IsMultiplexing) | ||
| return; | ||
|
|
||
| using var conn = await OpenConnectionAsync(); | ||
| await using (var tx = await conn.BeginTransactionAsync()) | ||
| { | ||
| Assert.That(conn.Connector, Is.Not.Null); | ||
| Assert.That(async () => await conn.ExecuteScalarAsync("SELECT * FROM \"unknown_table\"", tx: tx), | ||
| Throws.Exception.TypeOf<PostgresException>()); | ||
| Assert.That(conn.Connector, Is.Not.Null); | ||
| } | ||
|
|
||
| Assert.That(conn.Connector, Is.Null); | ||
| } |
There was a problem hiding this comment.
Bug3248_Dispose_transaction_Rollback is now an empty async test method, so it will always pass without exercising anything. Either remove this test entirely (if the scenario was multiplexing-only) or reintroduce a non-multiplexing assertion that reproduces #3248 so the regression remains covered.
| [Test] | ||
| [IssueLink("https://github.com/npgsql/npgsql/issues/3248")] | ||
| // More at #3254 | ||
| public async Task Bug3248_Dispose_connection_Rollback() | ||
| { | ||
| if (!IsMultiplexing) | ||
| return; | ||
|
|
||
| var conn = await OpenConnectionAsync(); | ||
| var tx = conn.BeginTransaction(); | ||
| Assert.That(conn.Connector, Is.Not.Null); | ||
| Assert.That(async () => await conn.ExecuteScalarAsync("SELECT * FROM \"unknown_table\"", tx: tx), | ||
| Throws.Exception.TypeOf<PostgresException>()); | ||
| Assert.That(conn.Connector, Is.Not.Null); | ||
|
|
||
| await conn.DisposeAsync(); | ||
| Assert.That(conn.Connector, Is.Null); | ||
| } |
There was a problem hiding this comment.
Bug3248_Dispose_connection_Rollback is now an empty async test method, so it will always pass and no longer protects against regressions. Please delete it or rewrite it to validate the intended rollback/dispose behavior in the non-multiplexing code path.
Move API changes from commits after v10.0.0 back to Unshipped, as they represent 11.0 work, not 10.0: - Remove multiplexing (#6457): 4 *REMOVED* entries - Remove large object API (#6493): 37 *REMOVED* entries - Add back parameterless ReloadTypesAsync (#6522): undo the v10.0 addition of CancellationToken overload and re-add the parameterless overload Also adjusts Shipped to correctly reflect the v10.0.0 public API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move API changes from commits after v10.0.0 back to Unshipped, as they represent 11.0 work, not 10.0: - Remove multiplexing (#6457): 4 *REMOVED* entries - Remove large object API (#6493): 37 *REMOVED* entries - Add back parameterless ReloadTypesAsync (#6522): undo the v10.0 addition of CancellationToken overload and re-add the parameterless overload Also adjusts Shipped to correctly reflect the v10.0.0 public API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Merge only after #6314.
Closes #6449