How to resolve an IllegalArgumentException when attempting to update a Destination Worker's Core Size and Maximum Size

Issue

  • When attempting to update the Worker Core Size and Worker Maximum Size (for example, changing the liferay/background_task destination name to a core size of 5 and a max size of 10), though the update appears successful in the UI, the logs show a "CM Configuration Updater" error and IllegalArgumentException such as the following:
    2020-11-25 01:18:24.065 ERROR [CM Configuration Updater (Update: pid=com.liferay.portal.messaging.internal.configuration.DestinationWorkerConfiguration.cb90ce61-5844-4817-9575-d4f4ad981e6a)][LogService:93] [org.osgi.service.cm.ManagedServiceFactory, com.liferay.portal.kernel.messaging.MessageBus, id=1112, bundle=913/com.liferay.portal.messaging.jar?lpkgPath=file:/drive/Liferay-Home/osgi/marketplace/Liferay%20Foundation%20-%20Liferay%20Portal%20-%20Impl.lpkg]: Unexpected problem updating configuration com.liferay.portal.messaging.internal.configuration.DestinationWorkerConfiguration.cb90ce61-5844-4817-9575-d4f4ad981e6a {org.osgi.service.cm.ConfigurationAdmin}={service.description=Configuration Admin Service Specification 1.6 Implementation, service.id=52, service.bundleid=31, service.scope=bundle, service.vendor=The Apache Software Foundation, service.pid=org.apache.felix.cm.ConfigurationAdmin}
    java.lang.IllegalArgumentException
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor.adjustPoolSize(ThreadPoolExecutor.java:90)
    at com.liferay.portal.messaging.internal.BaseAsyncDestination.setWorkersCoreSize(BaseAsyncDestination.java:197)
    at com.liferay.portal.messaging.internal.DefaultMessageBus.updateDestination(DefaultMessageBus.java:529)
    at com.liferay.portal.messaging.internal.DefaultMessageBus.updated(DefaultMessageBus.java:359)
    at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159)
    at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93)
    at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1391)
    at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
    at java.lang.Thread.run(Thread.java:748)
  • When checking the current destination worker values using a Groovy script, it appears that the new configurations did not take effect. We have confirmed that we are using an environment with the LPS-108986 fix implemented, so it is unexpected to be encountering this behavior, as the values of 5 and 10 should be allowed.

Environment

  • DXP 7.2
  • DXP 7.3

Resolution

  • Instead of updating both the Core Size and Maximum Size values at the same time (within Control Panel > Configuration > System Settings > Infrastructure > Destination Worker), first update the "Worker Maximum Size," then afterwards update the "Worker Core Size," as this will allow both configurations to be saved and used as expected (and will prevent the unexpected errors).

Additional Information

  • This behavior can be encountered due to a race condition within some earlier 7.2 and 7.3 patch levels, where it is possible that the "Worker Core Size" configuration is updated before the "Worker Maximum Size" configuration (when updating both), in which case this error may be encountered (as the core size cannot exceed the maximum). This is planned to be officially resolved within a future fix pack, once the fix for LPS-124209 is implemented.
  • More information on Destination Workers can be found in the following documentation:
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています