Akka.Remote - 分离后无法向远程参与者发送消息

Akka.Remote - cannot send messages to remote actor after dissassociation

我正在使用 Akka.Remote 在服务器端服务应用程序和多个桌面客户端应用程序之间进行通信。客户端向服务器发送请求消息(使用Akka.net)并等待服务器回复响应消息。客户端应用程序是暂时的,这意味着它们经常连接到服务器,保持连接一段时间,然后断开连接,然后重新连接。

我遇到的问题是,有时当客户端与服务器 actor 断开连接(通过关闭其 ActorSystem)然后重新连接回服务器时,它不会收到服务器的任何回复时间。几分钟后,通信工作没有任何问题。我发现当服务器向在请求期间断开连接且无法再访问的客户端发送回复时会发生此问题。服务器无法传递响应消息,并且它以某种方式将客户端端点标记为无效。

在日志中(在服务器端)当客户端断开连接时,我收到以下消息。

[DEBUG] 2016-01-21 13:04:58.6151 received AutoReceiveMessage <Terminated>: [akka.tcp://qb@client:8090/user/qb] - ExistenceConfirmed=True  ServerActor
[DEBUG] 2016-01-21 13:04:58.6550 Stopped  Akka.Remote.Transport.ProtocolStateActor
[ INFO] 2016-01-21 13:04:58.6550 Quarantined address [akka.tcp://qb@client:8090] is still unreachable or has not been restarted. Keeping it quarantined.  Akka.Event.DummyClassForStringSources
[DEBUG] 2016-01-21 13:04:58.6725 Stopped  Akka.Remote.ReliableDeliverySupervisor
[DEBUG] 2016-01-21 13:04:58.6725 no longer watched by [akka://myservice/system/endpointManager/reliableEndpointWriter-akka.tcp%3a%2f%2fqb%40client%3a8090-2]  Akka.Remote.EndpointWriter
[DEBUG] 2016-01-21 13:04:58.6725 Disassociated [akka.tcp://myservice@server:8081] <- akka.tcp://qb@client:8090  Akka.Remote.EndpointWriter
[DEBUG] 2016-01-21 13:04:58.6725 Stopped  Akka.Remote.EndpointWriter

然后当客户端尝试重新连接时,我得到:

[DEBUG] 2016-01-21 13:05:15.5883 ConnectResponse [akka.tcp://qb@client:8090/user/qb]  ServerActor
[DEBUG] 2016-01-21 13:05:16.0467 Started (Akka.Remote.Transport.ProtocolStateActor)  Akka.Remote.Transport.ProtocolStateActor
[DEBUG] 2016-01-21 13:05:16.0467 Stopped  Akka.Remote.Transport.ProtocolStateActor
[ WARN] 2016-01-21 13:05:16.0467 AssociationError [akka.tcp://myservice@server:8081] -> akka.tcp://qb@client:8090: Error [Invalid address: akka.tcp://qb@client:8090] []  Akka.Remote.EndpointWriter
[ INFO] 2016-01-21 13:05:16.0467 Quarantined address [akka.tcp://qb@client:8090] is still unreachable or has not been restarted. Keeping it quarantined.  Akka.Event.DummyClassForStringSources
[DEBUG] 2016-01-21 13:05:16.0643 Stopped  Akka.Remote.ReliableDeliverySupervisor
[DEBUG] 2016-01-21 13:05:16.0711 no longer watched by [akka://myservice/system/endpointManager/reliableEndpointWriter-akka.tcp%3a%2f%2fqb%40client%3a8090-4]  Akka.Remote.EndpointWriter
[DEBUG] 2016-01-21 13:05:16.0711 Disassociated [akka.tcp://myservice@server:8081] -> akka.tcp://qb@client:8090  Akka.Remote.EndpointWriter
[DEBUG] 2016-01-21 13:05:16.0711 Stopped  Akka.Remote.EndpointWriter
[DEBUG] 2016-01-21 13:05:16.0867 received AutoReceiveMessage <Terminated>: [akka://myservice/system/endpointManager/reliableEndpointWriter-akka.tcp%3a%2f%2fqb%40client%3a8090-4] - ExistenceConfirmed=True  Akka.Remote.EndpointManager
[DEBUG] 2016-01-21 13:05:16.0867 Terminated [akka.tcp://qb@client:8090/user/qb]  ServerActor

我怀疑此行为是 Akka.net 的一个特性,但是,我需要实现我的系统,以便客户端可以断开连接然后重新连接回服务器而无需等待。有什么方法可以禁用隔离机制或优雅地关闭服务器上的客户端端点,以便客户端端点不被隔离吗?

[ INFO] 2016-01-21 13:04:58.6550 Quarantined address [akka.tcp://qb@client:8090] is still unreachable or has not been restarted. Keeping it quarantined. - 这说明了一切。节点被隔离,需要重启 actor 系统。

但是,恕我直言 - 只需升级到我们周一发布的 Akka.NET 1.0.6。我们使远程处理策略管理器比以往更不脆弱。