Search code examples
wildfly-swarmthorntail

max-pool-size is invalid in combination with derive-size


For the last couple of days I’ve been battling with an issue which I believe is derived from a change in the source code in Thorntail and unfortunately this code doesn’t appear to be publically available.

The error I’ve been receiving is this:
"WFLYCTL0105: max-pool-size is invalid in combination with derive-size".
Previously you could just leave a “derive-size” out of the configuration and there wasn’t an issue however now anytime I’ve included the “max-pool-size” no matter what the combination with “derive-size” it fails with the above mentioned error.

  • From the latest Thorntail dococumentation:
    Specifies if and what the max pool size should be derived from. An undefined value (or the deprecated value 'none' which is converted to undefined) indicates that the explicit value of max-pool-size should be used.

This is what I had previously in WildFly project-defaults.yml which worked perfectly fine:

ejb3:
    default-resource-adapter-name: activemq-rar.rar
    default-mdb-instance-pool: mdb-strict-max-pool
    strict-max-bean-instance-pools:
      mdb-strict-max-pool:
        max-pool-size: 1

Any ideas or examples would be greatly appreciated.

More information added in response to questions:

The project was updated from using WildFly Swarm 2018.4.1 to use Thorntail 2.2.0.Final.

The code that appears to have changed in Thorntail is below:

OLD code: https://github.com/stuartwdouglas/wildfly-swarm-core/blob/master/ejb/api/src/main/java/org/wildfly/swarm/ejb/EJBFraction.java

.strictMaxBeanInstancePool(new StrictMaxBeanInstancePool("mdb-strict-max-pool").maxPoolSize(20).timeout(5L).timeoutUnit(StrictMaxBeanInstancePool.TimeoutUnit.MINUTES))

New Code: https://github.com/thorntail/thorntail/blob/802e785fdd515ecc1b52b22a64a6ff9338dace29/fractions/javaee/ejb/src/main/java/org/wildfly/swarm/ejb/EJBFraction.java

.strictMaxBeanInstancePool(new StrictMaxBeanInstancePool("mdb-strict-max-pool").deriveSize(StrictMaxBeanInstancePool.DeriveSize.FROM_CPU_COUNT).timeout(5L).timeoutUnit(StrictMaxBeanInstancePool.TimeoutUnit.MINUTES))

If anyone has a link to the above source code that would be great. The only links I can find appear to be from JBOSS so the code looks like it was ported accross and not made publicly avaiable.


Solution

  • After the question update: the default configuration of a couple of fractions was changed to better align with default configuration in WildFly 11. You can configure derive-size: null and then the max-pool-size should take effect.

    Something like:

    ejb3:
      default-resource-adapter-name: activemq-rar.rar
      default-mdb-instance-pool: mdb-strict-max-pool
      strict-max-bean-instance-pools:
        mdb-strict-max-pool:
          derive-size: null
          max-pool-size: 1
    

    (Note: previously, this answer recommended setting derive-size: none, but that doesn't work. After the discussion in comments, I changed the answer to recommend derive-size: null, which does work.)