james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-2295) JMS mailqueue deadlock when a single thread issue several consume
Date Fri, 13 Jul 2018 10:38:00 GMT

    [ https://issues.apache.org/jira/browse/JAMES-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542860#comment-16542860

ASF GitHub Bot commented on JAMES-2295:

Github user nstdio commented on a diff in the pull request:

    --- Diff: server/queue/queue-jms/src/test/java/org/apache/james/queue/jms/JMSMailQueueTest.java
    @@ -49,7 +49,8 @@ public void setUp(BrokerService broker) throws Exception {
             RawMailQueueItemDecoratorFactory mailQueueItemDecoratorFactory = new RawMailQueueItemDecoratorFactory();
             NoopMetricFactory metricFactory = new NoopMetricFactory();
             String queueName = BrokerExtension.generateRandomQueueName(broker);
    -        mailQueue = new JMSMailQueue(connectionFactory, mailQueueItemDecoratorFactory,
queueName, metricFactory);
    +        ConsumerOptions consumerOptions = name -> name + "?consumer.prefetchSize=0";
    --- End diff --
    > The problem with that kind of API is that I got not idea about values I should pass.
We can still expose the put you suggest, but we need a self-discoverable API for options we
    Agree with that, but as far as I know JMS spec does not support things like that. Although
we can provide pretty well documentation on that. In ActiveMQ case the builder API is pretty
straightforward and easy do understand (from API design point of view).
    > Why using a constructor when I can use a builder? Isn't it better to enforce builder
    I thought about when user already has ready . Probably we should expose also the `putAll(Map<String,
String>)` method in builder to not force user iterate over and add options one by one.

> JMS mailqueue deadlock when a single thread issue several consume
> -----------------------------------------------------------------
>                 Key: JAMES-2295
>                 URL: https://issues.apache.org/jira/browse/JAMES-2295
>             Project: James Server
>          Issue Type: Bug
>          Components: Queue
>    Affects Versions: 3.0.0, master, 3.0.1
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: bug
> This will lead to a dead lock:
> {code:java}
>         MailQueue.MailQueueItem mailQueueItem1 = getMailQueue().deQueue();
>         MailQueue.MailQueueItem mailQueueItem2 = getMailQueue().deQueue();
>         mailQueueItem1.done(true);
>         mailQueueItem2.done(true);
> {code}

This message was sent by Atlassian JIRA

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

View raw message