mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "白玉雄" <ba...@17car.com.cn>
Subject Re: How to debug ghost sessions
Date Wed, 06 May 2015 06:47:34 GMT
I am sure that idle event is fired. After no heartbeat for 900 seconds , session was closed
by server.
 
------------------ Original ------------------
From:  "Emmanuel Lécharny"<elecharny@gmail.com>;
Date:  Wed, May 6, 2015 02:31 PM
To:  "users"<users@mina.apache.org>; 

Subject:  Re: How to debug ghost sessions

 
Le 06/05/15 05:24, 白玉雄 a écrit :
> Hi all,
> My mina server neither process session request nor disconnect the session as idle. and
this happens only on few of sessions, most of them works well.
>
>
> Some Code:
> public void run(int port) throws IOException {
> 		this.acceptor = new NioSocketAcceptor();
> 		this.acceptor.setReuseAddress(true);
>
>
> 		this.acceptor.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ClwMessageProtocolCodecFactory()));
>
>
> 		this.acceptor.getFilterChain().addLast("logger", new LoggingFilter());
> 		this.acceptor.getFilterChain().addLast("threadPool", new ExecutorFilter(new UnorderedThreadPoolExecutor(PropertiesHander.getInt("MAXIMUM_POOL_SIZE",
16))));
>
>
> 		this.acceptor.getSessionConfig().setReadBufferSize(512);
> 		this.acceptor.getSessionConfig().setReceiveBufferSize(512);
> 		// set idle time, default 900 seconds
> 		this.acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE,PropertiesHander.getInt("SESSION_IDLE_TIME",900));
> 		this.acceptor.setHandler(ioHandler);
> 		this.acceptor.bind(new InetSocketAddress(port));
> 		LOGGER.info("Socket server Listening on port "+ PropertiesHander.getInt("SERVER_PORT",
port));
> 	}
>
>
>
> Some phenomenons:
> 1、The ghost session can be found by this.acceptor.getManagedSessions().get(sessionId)
> 2、If force the client disconnect from server and reconnect again, the client now works
well and request was processed normally.
>
> It seems that the session was stucked.
>
>
> Question:
> Why this happens 
No idea... You aren't providing enough information to know what's going on.

> and How to reappear and debug this?
Setting the idle time is good, but at some point you must check the
event that is fired when teh session has been idle for 900 seconds. Are
you doing that ?
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message