Stopping application server takes too much time
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
- Shutting down the application server waits indefinitely so we have to use kill command.
Resolution
- It can happen that a latch countdown to stop an OSGi service takes a lot of time, in any circumstance. Thus, the stuck OSGi service prevents the application server from stopping.
- However, Felix Declarative Services implementation (the OSGi framework used by DXP) has, via configuration, a timeout procedure to solve services gain and/or stop blocks during framework shutdown.
- The timeout configuration is accomplished by the following framework properties:
org.apache.felix.scr.impl.config.ScrConfiguration.DEFAULT_LOCK_TIMEOUT_MILLISECONDS = 5000;
org.apache.felix.scr.impl.config.ScrConfiguration.DEFAULT_STOP_TIMEOUT_MILLISECONDS = 60000;
- Nevertheless, these properties are redefined in DXP in
portal.properties
file with the following default values:
#
# Pass arbitrary extra properties to the framework using the prefix:
# "module.framework.properties." to avoid avoid colliding with other
# frameworks that may be running within the same JVM.
#
...
module.framework.properties.ds.lock.timeout.milliseconds=1800000
module.framework.properties.ds.stop.timeout.milliseconds=1800000
...
- So, the application server shutdown process would be affected by the OSGi framework's wait before the latter considers a timeout has happened. 1800000 milliseconds = 30 minutes.
- As a suggested solution, defining both properties in
portal-ext.propeties
file with suitable values for your system would avoid unnecessary waits.
Did this article resolve your issue ?