Here is the scrap of the log:
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.main - 
======================================
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.main - java.vm.version 
14.3-b01
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.main - os.name Windows XP
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.main - Configuring the TCP 
Server
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.setDebbugSessionOn - Set 
logging filter on. All the traffic will be logged, are you sure?
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.setIdelTime - Set session 
idle time (sec) 1000
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.start - Binding TCP 
protocol on host 127.0.0.1 on port 8447
14:11:54 14-09-2010 INFO  Thread:main ExampleServer.start - The TCP Server is 
up and running and looking forward for incoming requests :-)
14:12:09 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - CREATED
14:12:09 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - OPENED
14:12:09 14-09-2010 DEBUG Thread:NioProcessor-1 OrderedThreadPoolExecutor.debug 
- Adding event SESSION_OPENED to session 2
Queue : [SESSION_OPENED, ]

14:12:09 14-09-2010 DEBUG Thread:pool-3-thread-1 IoFilterEvent.debug - Firing a 
SESSION_OPENED event for session 2
14:12:09 14-09-2010 INFO  Thread:pool-3-thread-1 
TesterSessionHandler.sessionOpened - Session Opened ignore incoming messages 
unless 'Start' command
14:12:09 14-09-2010 DEBUG Thread:pool-3-thread-1 IoFilterEvent.debug - Event 
SESSION_OPENED has been fired for session 2
14:12:10 14-09-2010 INFO  Thread:Thread-1 FileWithHeaderWriteFilter.getHeader - 
SENDING header 157
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - SENT: 
HeapBuffer[pos=0 lim=157 cap=157: 00 00 00 99 3C 47 65 74 4D 65 73 73 61 67 65 
52...]
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 
FileWithHeaderWriteFilter.getFile - SENDING file 1451
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - SENT: 
HeapBuffer[pos=0 lim=1451 cap=1451: 50 4B 03 04 14 00 08 00 08 00 5C 5D 53 3B 
00 00...]
14:12:10 14-09-2010 INFO  Thread:Thread-1 FileWithHeaderWriteFilter.getHeader - 
SENDING header 157
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 
FileWithHeaderWriteFilter.getHeader - SENDING header 157
14:12:10 14-09-2010 DEBUG Thread:NioProcessor-1 OrderedThreadPoolExecutor.debug 
- Adding event MESSAGE_SENT to session 2
Queue : [MESSAGE_SENT, ]

14:12:10 14-09-2010 DEBUG Thread:pool-3-thread-1 IoFilterEvent.debug - Firing a 
MESSAGE_SENT event for session 2
14:12:10 14-09-2010 INFO  Thread:pool-3-thread-1 
TesterSessionHandler.messageSent - Message sent successfully
14:12:10 14-09-2010 DEBUG Thread:pool-3-thread-1 IoFilterEvent.debug - Event 
MESSAGE_SENT has been fired for session 2
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - SENT: 
HeapBuffer[pos=0 lim=157 cap=157: 00 00 00 99 3C 47 65 74 4D 65 73 73 61 67 65 
52...]
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 
FileWithHeaderWriteFilter.getFile - SENDING file 1452
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 LoggingFilter.info - SENT: 
HeapBuffer[pos=0 lim=157 cap=157: 00 00 00 99 3C 47 65 74 4D 65 73 73 61 67 65 
52...]
14:12:10 14-09-2010 INFO  Thread:NioProcessor-1 
FileWithHeaderWriteFilter.getHeader - SENDING header 156
14:12:10 14-09-2010 DEBUG Thread:NioProcessor-1 OrderedThreadPoolExecutor.debug 
- Adding event MESSAGE_SENT to session 2
Queue : [MESSAGE_SENT, ]



-----Original Message-----
From: Guy Itzhaki [mailto:[email protected]] 
Sent: Tuesday, September 14, 2010 2:25 PM
To: [email protected]; [email protected]
Subject: RE: Possible synchronization issue

Emmanuel, thanks for the quick response.

OrderedThreadPool didn't help.

The attached log might help you understand better what is happening - as said 
before every sent message has 2 parts, a header (~157 bytes) and a file (around 
1-1.5 kb).
Therefore I would expect the NIOProcessor to process first a small buffer (~157 
bytes) and then a larger one (around 1-1.5 kb) repeatedly. 
As you can see in the log the Thread:NioProcessor-1 indeed processes 157 bytes 
long HeapBuffer (which is the header), and than 1451 long HeapBuffer (which is 
the file content). BUT after that, as you can see in line 22, the second call 
to FileWithHeaderWriteFilter sneaked in...

Thanks,
Guy




-----Original Message-----
From: Emmanuel Lécharny [mailto:[email protected]] 
Sent: Tuesday, September 14, 2010 1:15 PM
To: [email protected]
Subject: Re: Possible synchronization issue

  On 9/14/10 1:07 PM, Guy Itzhaki wrote:
> No.
> This is the filter I'm using:
> new ExecutorFilter(Executors.newFixedThreadPool(2))

Try to use the OrderedThreadPool then.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com



Click here to report this message as SPAM: 
http://vsp.ateranetworks.com/ReportSpam.php?sid=bac6f639c55903f79d352fe268f89f82_091d39d20cd5550151002e16cad2865b
-- Powered by ATERA Networks --



Reply via email to