jca default workmanager available threads no more than the core-threads

Posted on

Hi,

For a custom JCA resource adapter, at a standalone JBoss EAP 6.4.0.GA instance,
the default workmanager is used with the following configuration for the short running threads:

<default-workmanager>
    <short-running-threads allow-core-timeout="true">
        <core-threads count="5" />
        <queue-length count="10" />
        <max-threads count="10" />
        <keepalive-time time="900" unit="seconds" />
    </short-running-threads>
    ...
</default-workmanager>

The problem is that for eight concurrent JCA resource adapter clients, the workmanager does not create more than five threads.
The status of the short-running-threads pool produced by the related cli command is the following:

standalone@localhost:9999 /] /subsystem=jca/workmanager=default/short-running-threads=default:read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "allow-core-timeout" => true,
        "core-threads" => 5,
        "current-thread-count" => 5,
        "handoff-executor" => undefined,
        "keepalive-time" => {
            "time" => 900L,
            "unit" => "SECONDS"
        },
        "largest-thread-count" => 5,
        "max-threads" => 10,
        "name" => "default",
        "queue-length" => 10,
        "queue-size" => 1,
        "rejected-count" => 0,
        "thread-factory" => undefined
    }
}

At the previous output, also note that the queue-size is one.
When the first five clients complete their work, the workmanager allocates threads for the rest three clients.
In this case, the status of the short-running-threads pool is the following:

[standalone@localhost:9999 /] /subsystem=jca/workmanager=default/short-running-threads=default:read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "allow-core-timeout" => true,
        "core-threads" => 5,
        "current-thread-count" => 5,
        "handoff-executor" => undefined,
        "keepalive-time" => {
            "time" => 900L,
            "unit" => "SECONDS"
        },
        "largest-thread-count" => 5,
        "max-threads" => 10,
        "name" => "default",
        "queue-length" => 10,
        "queue-size" => 0,
        "rejected-count" => 0,
        "thread-factory" => undefined
    }
}

The core-threads parameter seems to act like the max-threads parameter, since if core-threads=5 and max-threads=10,
the thread pool can not have more than 5 threads. The only effect that max-threads parameter has,
is that the number of the core threads can not exceed it. For example, if core-threads=10 and max-threads=5,
the thread pool can not have more that 5 threads.

Thanks in advance,

John Psoroulas

Responses