This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new fc80eadf7a4 IGNITE-24827 .NET: Fix error in log on graceful disconnect
(#5522)
fc80eadf7a4 is described below
commit fc80eadf7a4d4f4f3755188c20586c1966ec23c1
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon Mar 31 13:31:29 2025 +0300
IGNITE-24827 .NET: Fix error in log on graceful disconnect (#5522)
---
modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs | 3 ++-
modules/platforms/dotnet/Apache.Ignite/Internal/ClientSocket.cs | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
index 1410f4aa7b0..14304e9ad58 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
@@ -46,7 +46,7 @@ public class LoggingTests
SocketTimeout = TimeSpan.FromSeconds(1)
};
- using var servers = FakeServerGroup.Create(3);
+ using (var servers = FakeServerGroup.Create(3))
using (var client = await servers.ConnectClientAsync(cfg))
{
client.WaitForConnections(3);
@@ -68,6 +68,7 @@ public class LoggingTests
StringAssert.Contains("[Trace] Received response [requestId=1,
flags=PartitionAssignmentChanged, remoteAddress=", log);
StringAssert.Contains("op=SqlExec", log);
StringAssert.Contains("[Debug] Connection closed gracefully", log);
+ StringAssert.DoesNotContain("[Error]", log);
}
[Test]
diff --git a/modules/platforms/dotnet/Apache.Ignite/Internal/ClientSocket.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/ClientSocket.cs
index 8c296006ed4..2f30e2f316c 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/ClientSocket.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/ClientSocket.cs
@@ -777,6 +777,12 @@ namespace Apache.Ignite.Internal
}
catch (Exception e)
{
+ if (IsDisposed || e is OperationCanceledException)
+ {
+ // Connection is closing - ignore.
+ return;
+ }
+
var message = "Exception while reading from socket, connection
closed: " + e.Message;
_logger.LogSocketIoError(e, message);