From ee974940c03e09a363207d8fa1df6a8552f98c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6llner?= Date: Fri, 23 Aug 2019 23:35:22 +0200 Subject: [PATCH] Test troubleshooting --- Capnp.Net.Runtime.Tests/TcpRpcPorted.cs | 1 + Capnp.Net.Runtime/Rpc/TcpRpcServer.cs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Capnp.Net.Runtime.Tests/TcpRpcPorted.cs b/Capnp.Net.Runtime.Tests/TcpRpcPorted.cs index 01658a8..24afd14 100644 --- a/Capnp.Net.Runtime.Tests/TcpRpcPorted.cs +++ b/Capnp.Net.Runtime.Tests/TcpRpcPorted.cs @@ -446,6 +446,7 @@ namespace Capnp.Net.Runtime.Tests Assert.IsTrue(resolving.WhenResolved.Wait(MediumNonDbgTimeout)); var cap = new TestCallOrderImpl(); + cap.CountToDispose = 6; var earlyCall = main.GetCallSequence(0, default); diff --git a/Capnp.Net.Runtime/Rpc/TcpRpcServer.cs b/Capnp.Net.Runtime/Rpc/TcpRpcServer.cs index 54ceedf..8678ca1 100644 --- a/Capnp.Net.Runtime/Rpc/TcpRpcServer.cs +++ b/Capnp.Net.Runtime/Rpc/TcpRpcServer.cs @@ -193,9 +193,19 @@ namespace Capnp.Rpc try { - if (!_acceptorThread.Join(500)) + try { - Logger.LogError("Unable to join TCP acceptor thread within timeout"); + if (!_acceptorThread.Join(500)) + { + Logger.LogError("Unable to join TCP acceptor thread within timeout"); + } + } + catch (ThreadStateException) + { + } + catch (System.Exception exception) + { + Logger.LogError($"Unable to join TCP acceptor thread: {exception.Message}"); } } catch (ThreadStateException)