directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trustin Lee (JIRA)" <>
Subject [jira] Commented: (DIRMINA-65) Duplicate entries in flush-list, consequent unnecessary system-calls and overzealous wakeups and calls to write(2)
Date Tue, 28 Jun 2005 17:47:57 GMT
    [ ] 

Trustin Lee commented on DIRMINA-65:

Thank you for posting a patch for this issue first of all, Mark.  I appologize for this late
reply.  I'm pretty busy these days. :)

Did you get any clue about ' Invalid argument' exception message, BTW?
 If the selector recovers itself automatically in the next loop, it shouldn't be problem.

> Duplicate entries in flush-list, consequent unnecessary system-calls and overzealous
wakeups and calls to write(2)
> ------------------------------------------------------------------------------------------------------------------
>          Key: DIRMINA-65
>          URL:
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.2, 0.7.1, 0.7
>  Environment: All 
>     Reporter: Mark Atwell
>     Assignee: Trustin Lee
>      Fix For: 0.7.3
>  Attachments:
> The following shows up under heavy load - writing numerous small messages across a slow(ish)
network and/or to a slow peer i.e. when a writer starts to see back-log and writes don't necessarily
> In SocketIoProcessor:
> - scheduleFlush() blindly adds the session to the queue even if it is already present.
This means that when the selector thread wakes up it may make numerous calls to (relatively
slow) write on the same session.
> - flushSession() calls scheduleFlush() and always wakes up the selector thread. This
means that flushSessions() and flush() is called for each application write - even when the
socket may already be backed up with queued traffic. This is exacerbated by the problem above.
> - scheduleFlush() is called from flushSession() which is called from (at least) SocketSessionManagerFilterChain
for every application write.
> I 'hacked' a test fix which modified scheduleFlush() to only add the session if it wasn't
already in the queue and returns a boolean indicating whether the session was added. flushSession()
checks this return value and only wakes the selector thread if the session has been added
(i.e. it isn't already backed up). In this way writes are not unnecessarily triggered.
> This worked though it also highlighted (or brought into greater focus? :o) an apparent
timing problem.
> Invalid argument
> 	at Method)
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at$
> This isn't fatal though as the retry logic means that the next time 'round the state
- presumably of the selection keys - has been brought into alignemnt?

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message