synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SYNAPSE-434) Concurrency level provided by the mail and VFS transports listeners is insufficient
Date Sat, 21 Mar 2009 10:27:51 GMT

    [ https://issues.apache.org/jira/browse/SYNAPSE-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688011#action_12688011
] 

Andreas Veithen commented on SYNAPSE-434:
-----------------------------------------

Of course we need to avoid to process the same message twice. This can be achieved if me make
sure that for a given service, a new poll is only scheduled when the current poll is completed.
For the moment the mail and VFS transports work as follows:

1. Start poll (open mail folder and read message list; read directory).
2. Sequentially process each message.
3. Schedule the next poll.

The idea is to change that (as an option) to:

1. Start poll
2. Process the messages in parallel (with a configurable level of concurrency)
3. Wait until all messages have been processed and schedule the next poll.

Note that this solution probably doesn't provide enough concurrency for what is requested
in the linked issue WSCOMMONS-454.


> Concurrency level provided by the mail and VFS transports listeners is insufficient
> -----------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-434
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-434
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>            Priority: Minor
>
> Scenario:
> * Two services are configured to use the (mail or VFS) transport.
> * Two messages are sent two each of these services.
> In this case, one would expect that the transport listener will be able to process at
least 2 (better 4) messages concurrently. However the listener currently only processes one
message at a time, i.e. the listener behaves as if it was single-threaded.
> There are two reasons for this:
> 1. AbstractPollingTransportListener contains the following code:
> workerPool.execute(new Runnable() {
>     public void run() {
>         synchronized (pollLock) {
>             pollInProgress = true;
>             try {
>                 onPoll();
>             } finally {
>                 pollInProgress = false;
>             }
>         }
>     }
> });
> Since pollLock is a member of AbstractPollingTransportListener, there can only be one
poll in progress at a time, even if several services are configured to use the transport (in
which case nothing would prevent the transport from executing the polls for the different
services in parallel).
> 2. Both MailTransportListener and VFSTransportListener process incoming messages sequentially.
Here again, the transport could process several messages in parallel during the execution
of the onPoll method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message