qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Commented] (QPID-7615) Cannot set number of selectors equal to pool size
Date Thu, 12 Sep 2019 15:18:00 GMT

    [ https://issues.apache.org/jira/browse/QPID-7615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16928639#comment-16928639
] 

ASF GitHub Bot commented on QPID-7615:
--------------------------------------

alex-rufous commented on pull request #34: QPID-7615 Number of selectors can be equal to connection
thread pool size
URL: https://github.com/apache/qpid-broker-j/pull/34#discussion_r323795243
 
 

 ##########
 File path: broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
 ##########
 @@ -509,31 +509,47 @@ public void testExistingConnectionBlocking()
     }
 
     @Test
-    public void testCreateValidation()
+    public void testSelectorNumberMustBePositiveOnCreate()
     {
+        createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
"1"));
         try
         {
-            createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
-                                                                      "-1"));
-            fail("Exception not thrown for negative number of selectors");
+            createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
"0"));
+            fail("Exception not thrown for non-positive number of selectors");
         }
         catch (IllegalConfigurationException e)
         {
             // pass
         }
+    }
+
+    @Test
+    public void testConnectionThreadPoolSizeMustBePositiveOnCreate()
+    {
+        final Map<String, Object> vhAttributes = new HashMap<>();
+        vhAttributes.put(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE, 1);
+        vhAttributes.put(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, 1);
+        createVirtualHost(getTestName(), vhAttributes);
         try
         {
-            createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE,
"-1"));
-            fail("Exception not thrown for negative connection thread pool size");
+            createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE,
"0"));
+            fail("Exception not thrown for non-positive connection thread pool size");
         }
         catch (IllegalConfigurationException e)
         {
             // pass
         }
+    }
+
+    @Test
+    public void testSelectorNumberMustBeLessOrEqualToThePoolSizeOnCreate()
+    {
+        createVirtualHost(getTestName(), Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
QueueManagingVirtualHost.DEFAULT_VIRTUALHOST_CONNECTION_THREAD_POOL_SIZE - 1));
 
 Review comment:
   The test can be strengthen with asserts verifying that specified values are indeed  set
on the corresponding attributes
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Cannot set number of selectors equal to pool size
> -------------------------------------------------
>
>                 Key: QPID-7615
>                 URL: https://issues.apache.org/jira/browse/QPID-7615
>             Project: Qpid
>          Issue Type: Bug
>          Components: Broker-J
>    Affects Versions: qpid-java-6.1.1
>            Reporter: James Howe
>            Priority: Minor
>
> For both Port and VirtualHost, the number of selectors is required to be strictly less
than the pool size.
> In particular, this means a pool size of 1 is not possible, as would be desired for a
minimal embedded/test configuration.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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


Mime
View raw message