2

Using Akka.net I am trying to implement simple scenario. I have created 2 servers and 1 client, where Servers receives the messages sent from client and processes it.

Setup works fine sometimes and sometimes it gives following error, I am not able to figure out the cause:

**

No response from remote. Handshake timed out or transport failure detector triggered.
Cause: Unknown
Association with remote system akka.tcp://RemoteFSharp@172.27.**.94:8777 has
failed; address is now gated for 5000 ms. Reason is: [Akka.Remote.EndpointDisass
ociatedException: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)]

**

Client Config:

akka {
       log-dead-letters-during-shutdown = off

        actor {
        handshake-timeout = 600 s

        serializers {
            wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
          }
        serialization-bindings {
          "System.Object" = wire
        }
          provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
        }
        remote {
            helios.tcp {
                maximum-frame-size = 20000000b
                tcp-keepalive = on
                transport-class =
          "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
                transport-protocol = tcp
                port = 8760
                hostname = 172.27.**.94
                }
          }
        log-remote-lifecycle-events = INFO
      }

Server Config :

      akka {
        log-dead-letters-during-shutdown = off
        actor {

        handshake-timeout = 600 s
        serializers {
            wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
          }
        serialization-bindings {
          "System.Object" = wire
        }
          provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
        }
        remote {
        helios.tcp {
              maximum-frame-size = 20000000b
              tcp-keepalive = on
              transport-class =
        "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
              transport-protocol = tcp
              port = 8777
              hostname = 172.27.**.94
          }
          }
        log-remote-lifecycle-events = INFO
      }

Also I am using Newtonsoft.Json for serialization as follows:

let CreateEmployeeActor (system: ActorSystem) actorName  =
    (spawn system actorName
        (fun mailbox ->
            let rec loop (count: int)= 
                actor {
                    let! message = mailbox.Receive()
                    let sender = mailbox.Sender()
                    let deserializedEmailData = JsonConvert.DeserializeObject<EmployeeActorMsgs> (message)
                    match deserializedEmailData with
                    | InItEmployee ->
                //Some Logic

                }
            loop (0)
            ))
Pankaj Chouthmal
  • 195
  • 1
  • 11
  • What version of Akka and Wire are you using? Also some code would be useful. This exception may be caused by various reasons, one of the most probable is old version of akka cluster plugin or error thrown during message serialization/deserialization. – Bartosz Sypytkowski Jul 18 '16 at 18:17
  • thanks for your valuable response @Horusiath. I am using Akka.1.0.8 and Wire.0.0.6 for serialization. – Pankaj Chouthmal Jul 21 '16 at 08:30
  • @Horusiath I have added some serialization code in problem statement. Is this is how serialization works with Akka or am I doing it in wrong way ? – Pankaj Chouthmal Jul 21 '16 at 08:41
  • no, you don't need to use JsonConvert - especially since you've already set Wire as default serializer. Try upgrading Akka to 1.1.1 - this may solve the problem. – Bartosz Sypytkowski Jul 21 '16 at 14:11
  • @Horusiath upgrading to Akka 1.1.1 solved my problem. – Pankaj Chouthmal Aug 03 '16 at 09:28

0 Answers0