How to resolve an IllegalArgumentException when attempting to update a Destination Worker's Core Size and Maximum Size
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
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.
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).
Did this article resolve your issue ?