MinQTP and MaxQTP in HTTP connector is not allowed to be set to 1

MinQTP and MaxQTP in HTTP connector is not allowed to be set to 1

book

Article ID: KB0073042

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 6.x

Description

When We use Min QTP and Max QTP with value as '1' in HTTP connector resource then application startup will fail with below error

-------------------------------
<CausedBy> java.lang.IllegalStateException: Insufficient configured threads: required=3 < max=3 for QueuedThreadPool[bwResourceHTTPConnector.qtp]@2c04c087{STARTED,3<=3<=3,i=3,r=1,q=0}[ReservedThreadExecutor@6a16e282{s=0/1,p=0}
-------------------------------

The same configuration used to work older version till BW6.5.0.



Root Cause/Analysis:
==============
This is the expected behavior in later versions(after BW 6.5.0) because of the Jetty version upgrade. This is a limitation of the Jetty Component. 

For more information please go through the below information.

Jetty has upgraded its Thread Allocation mechanism since 9.4.8 version and the same has been evolving with the later versions of it as well. 
Please find the compiled release notes for the different versions of Jetty at the link below:

https://fossies.org/linux/jetty-distribution/VERSION.txt
From this, we can mainly refer to the 9.4.8 *version notes and to be exact refer to the point number + 1851*. (attached jetty-project-9.4.8.txt)


Jetty has introduced a validation for minimum required threads for QTP mainly for the below classes. This observation is purely based on the actual debugging done over the Jetty jars as no explicit detailed mention in the release note can be found for it.
Connector class - acceptor thread
SelectorManager class - selector thread
ReservedThreadExecutor class - reserved thread


In case of Min QTP and Max QTP set to 1 would not satisfy the minimum requirement of the Thread Allocation mechanism and fail the validation at Jetty end. This wasn't happening before 9.4.8 since there was no validation added back then and used to work even with the insufficient number of threads.

BW Studio and Jetty version mapping can be found here:
Prior to BW 651 ==> Jetty 8.1.16
BW 651 ==> Jetty 9.4.8
BW 660 ==> Jetty 9.4.18
BW 670 HF03 ==> Jetty 9.4.41

Environment

All

Resolution

Workaround : If Minimum QTP Threads is 1 then set the Max QTP Threads value to anything greater than 1.

Note: In case the user wants to keep Min QTP = Max QTP = 1 then setting Acceptor Thread = 2 would also help given that the system CPU core value is >= 8.
Since below is the formula used to calculate the maximum allowed Acceptor Threads that would be allocated actually:
Acceptor Threads = Math.max(1, (Runtime.getRuntime().availableProcessors() + 3) / 4)

Issue/Introduction

MinQTP and MaxQTP in HTTP connector is not allowed to be set to 1 starting from BW 6.5.1

Attachments

MinQTP and MaxQTP in HTTP connector is not allowed to be set to 1 get_app