Hi,
Thanks in advance.
I
have three server. Two of them are websocket servers. The last server
is a business server. They use Akka Remote Module to communicate.
Two websocket servers listen to web socket connections. When one
websocket server gets a web socket connection , it creates a ClientActor
for the websocket connection and the ClientActor sends a ConnectionOpened
message to the only MasterActor in the business server via
ActorSelection. The MasterActor creates a BusinessActor who returns
back a ConnectionRegistered message to the sender of the ConnectionOpened
message. Now the ClientActor has the ActorRef of the BusinessActor and
watches it. When the BusinessActor dies(for example the business server
restarts), the corresponding ClientActor will close websocket connection
and kill itself. The websocket client app may retry websocket
connection after a period.
Today we restarted the business server to upgrade it. But something strange happened.
After the business server started, Websocket server A has a tcp
connection with the business server. But Websocket server B has two tcp
connections with the business server. When websocket server B accepted a
web socket connection, it created a CilentActor. The new ClientActor
sent a ConnectionOpen Message to the business server , but it didn't
receive ConnectionRegistered message.
I opened akka debug log in business server and websocket servers.
But the websocket server B's akka log doesn't say that it received ConnectionRegistered message:
2015-11-25 23:27:05,090;DEBUG;EndpointWriter;(websocket-actors-akka.actor.default-dispatcher-30);sending message RemoteMessage: [ActorSelectionMessage(ConnectionOpened [device=[eId=7290]]],Vector(user, autoserver),false)] to [Actor[akka.tcp://
businessserve...@10.170.187.126:2554/]]<+[akka.tcp:/
businessserve@10.170.187.126:2554/] from [Actor[akka://websocket-actors/user/websocket_actor_supervisor/did:7290#-1266191974]]
But
everything is ok for websocket server A. There was only a tcp
connection between it and businessserver. And it received
ConnectionRegistered messages.
What's wrong with
websocket server B? Is it ok for two tcp connections between websocket
server B and business server? What I should do to avoid it?
The netstat's output:
We use akka-remote_2.10-2.3.12.jar
business server's application.conf:
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
log-received-messages = on
log-sent-messages = on
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = 10.170.187.126
port = 2554
}
}
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
}
The websocket server's application.conf is similar.