I have a problem with akka 2.2.3 and code like this 

class ProtobufEndpoint (local: InetSocketAddress) extends Actor with 
ActorLogging {
  implicit def system = context.system
  IO(Tcp) ! Bind(self, local)
  def receive: Receive = {
    case _: Bound ⇒
      context.become(bound(sender))
  }

  def bound(listener: ActorRef): Receive = {
    case Connected(remote, _) ⇒
      val init = TcpPipelineHandler
        .withLogger(log,
          new TcpReadWriteAdapter >>
          new BackpressureBuffer(lowBytes = 100, highBytes = 1000, maxBytes 
= 1000000))
      val connection = sender
      val handler = context.actorOf(Props(new ProtobufRequestHandler(init, 
connection, remote.getAddress.getHostAddress))
        .withDispatcher(Configuration.PROTOBUF_HANDLER_DISPATCHER))
      val pipeline = context.actorOf(TcpPipelineHandler.props(init, 
connection, handler))
      connection ! Tcp.Register(pipeline)
}}

class ProtobufRequestHandler(init: Init[WithinActorContext, ByteString, 
ByteString], connection: ActorRef,
                             clientIp: String) extends Actor with 
ActorLogging {

  def receive = {
    case init.Event(data) => ...
}
  override def unhandled(message: Any): Unit = message match {
    case _: Tcp.ConnectionClosed ⇒
      context.stop(self)
    case _ => super.unhandled(message)
  }

}

over some time i have lots of ProtobufRequestHandler actors and my app 
crashes with OOME
somehow i'm not receiving ConnectionClosed events from 
ProtobufRequestHandler  for every open connection
what might be the reason?

On Wednesday, October 16, 2013 10:52:31 AM UTC+3, Akka Team wrote:
>
> Hi,
>
> It appears that the firewall was killing the connection when it was idle 
>> for too long.
>> The socket was created without keep alive, this might resolve our issue.
>>
>> I still think akka io should report something though.
>>
>
> If the OS does not report the socket as closed to the JVM then we cannot 
> really do anything. You said that you observed the send queue to be 
> growing, so I assume that the socket was still considered alive by the OS. 
> Or I am missing something :)
>
> -Endre
>  
>
>>
>>
>>
>> On Monday, October 14, 2013 4:10:26 AM UTC-4, Akka Team wrote:
>>
>>> Hi,
>>>
>>> Is there any news on this? We might need a reproducible test case to be 
>>> able to debug this problem.
>>>
>>> -Endre
>>>
>>>
>>> On Sun, Oct 13, 2013 at 5:53 PM, Patrik Nordwall 
>>> <[email protected]>wrote:
>>>
>>>>  Strange. Could it be something wrong with the way you use the Redis 
>>>> protocol? What happens if you watch the Connection actor?  Do you have a 
>>>> test case that we can try?
>>>>
>>>> /Patrik
>>>>  
>>>>
>>>> On Fri, Oct 11, 2013 at 6:32 PM, <[email protected]> wrote:
>>>>
>>>>>  I am having issue with akka.io.IO and akka.io.Tcp. I have a lot of 
>>>>> different behaviours for something that seem to be the same error.
>>>>> This is a typical client application (that talks to redis).
>>>>>
>>>>> *Scenario 1 (100% Working):*
>>>>> Connection has been created :
>>>>> - Tcp.Write
>>>>> - Get a CommandAck
>>>>> - Get a Tcp.Received
>>>>> (Success)
>>>>>
>>>>> *Scenario 2 (Recovers successfully):*
>>>>> Connection has been created :
>>>>> - Tcp.Write
>>>>> - Get a CommandAck
>>>>> - Get a Tcp.Received
>>>>> (Success)
>>>>> Then 
>>>>> - Tcp.Write
>>>>> - Get a CommandAck
>>>>> - nothing more
>>>>> Then
>>>>> -Tcp.ConnectionClosed
>>>>> we recover and do a connection ! Connect)
>>>>> -Tcp.Connected
>>>>> (Success, back in normal state)
>>>>>
>>>>> *Scenario 3 (Bad State):*
>>>>> Connection has been created :
>>>>> - Tcp.Write
>>>>> - Get a CommandAck
>>>>> - Get a Tcp.Received
>>>>> (Success)
>>>>> Then 
>>>>> - Tcp.Write
>>>>> - Get a CommandAck
>>>>> (Nothing more, tcp connection seems broken but no Tcp.ConnectionClosed)
>>>>>
>>>>> If I do a netstat at this point, I can see send-Q is growing but no 
>>>>> data is received on the server.
>>>>> Then I kill the connection on the server, but the connection stays on 
>>>>> the client side and it's still not sending a Tcp.ConnectionClosed.
>>>>> It looks like the connection will stay in this bad state forever.
>>>>>
>>>>>
>>>>> I am sure there is something going on with the connection but 
>>>>> shouldn't akka io send a ConnectionClosed message ?
>>>>>
>>>>>  -- 
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>> >>>>>>>>>> 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/groups/opt_out.
>>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>>
>>>> Patrik Nordwall
>>>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>>>> Twitter: @patriknw
>>>>
>>>>  -- 
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>> >>>>>>>>>> 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/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Akka Team
>>> Typesafe - The software stack for applications that scale
>>> Blog: letitcrash.com
>>> Twitter: @akkateam
>>>  
>>  -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      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/groups/opt_out.

Reply via email to