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. 

The business servers log showed it sent ConnectionRegistered message back:
2015-11-25 
23:27:05,091;DEBUG;EndpointWriter;(businessserver-akka.actor.default-dispatcher-17);received
 
local message RemoteMessage: [ActorSelectionMessage(ConnectionOpened 
[device=[eId=7290]],Vector(user, master),false)] to 
[Actor[akka://businessserver/]]<+[akka://businessserver/] from 
[Actor[akka.tcp://
[email protected]:2553/user/websocket_actor_supervisor/did:7290#-1266191974]()
 
<http://[email protected]:2553/user/websocket_actor_supervisor/did:7290#-1266191974]%28%29>
]
2015-11-25 
23:27:05,102;DEBUG;EndpointWriter;(businessserver-akka.actor.default-dispatcher-4);sending
 
message RemoteMessage: 
[com.ainemo.protocol.websocket.ConnectionRegistered@4be4c643] to 
[Actor[akka.tcp://
[email protected]:2553/user/websocket_actor_supervisor/did:7290#-1266191974]
]<+[akka.tcp://
[email protected]:2553/user/websocket_actor_supervisor/did:7290] 
from [Actor[akka://businessserver/user/master/$fj#-1775937842]]

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://
[email protected]:2554/] 
<http://[email protected]:2554/%5D>]<+[akka.tcp:/
[email protected]: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:
[root@dev-sig-server ~]# netstat -anp | grep 2554
tcp        0      0 10.170.187.126:2554         
0.0.0.0:*                                 
LISTEN                             4119/java
tcp        0      0 10.170.187.126:2554         10.162.209.21:32833         
ESTABLISHED                4119/java
tcp        0      0 10.170.187.126:2554         10.162.198.161:33326       
ESTABLISHED               4119/java
tcp        0      0 10.170.187.126:2554         10.162.209.21:32843         
ESTABLISHED                 4119/java


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.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to