This closes #3224
This commit is contained in:
commit
f46527b2e0
|
@ -176,7 +176,8 @@ public class JournalStorageManager extends AbstractJournalStorageManager {
|
|||
|
||||
largeMessagesFactory = new NIOSequentialFileFactory(config.getLargeMessagesLocation(), false, criticalErrorListener, 1);
|
||||
|
||||
if (config.getPageMaxConcurrentIO() != 1) {
|
||||
// it doesn't make sense to limit paging concurrency < 0
|
||||
if (config.getPageMaxConcurrentIO() >= 0) {
|
||||
pageMaxConcurrentIO = new Semaphore(config.getPageMaxConcurrentIO());
|
||||
} else {
|
||||
pageMaxConcurrentIO = null;
|
||||
|
|
|
@ -91,6 +91,20 @@ public class JournalStorageManagerTest extends ActiveMQTestBase {
|
|||
testExecutor.shutdownNow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDisablePageConcurrentMax() throws Exception {
|
||||
if (journalType == JournalType.ASYNCIO) {
|
||||
assumeTrue("AIO is not supported on this platform", AIOSequentialFileFactory.isSupported());
|
||||
}
|
||||
final Configuration configuration = createDefaultInVMConfig().setJournalType(journalType);
|
||||
configuration.setPageMaxConcurrentIO(-1);
|
||||
final ExecutorFactory executorFactory = new OrderedExecutorFactory(executor);
|
||||
final ExecutorFactory ioExecutorFactory = new OrderedExecutorFactory(ioExecutor);
|
||||
final JournalStorageManager manager = new JournalStorageManager(configuration, null, executorFactory, null, ioExecutorFactory);
|
||||
// if -1 is being set it means that we should first call afterPageRead to acuire the permit to read a page
|
||||
Assert.assertTrue(manager.beforePageRead(0, TimeUnit.NANOSECONDS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of fixJournalFileSize method, of class JournalStorageManager.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue