AEM Managed Services publisher unhealthy due to Sling Scripting JSP race condition
This article describes how to resolve a scenario where an Adobe Experience Manager (AEM) Managed Services publisher becomes unhealthy due to a race condition in the Apache Sling Scripting JSP module, typically triggered by memory pressure. The solution involves applying a hotfix provided by Adobe Support.
Description description
Environment
Adobe Experience Manager (AEM) Managed Services (all supported versions)
Symptoms
- Publisher instance is removed from the load balancer due to health check failures.
- Service is restored after a restart, but the issue recurs.
- Error logs show exceptions related to JSP compilation and file deletion failures, such as:
org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: An exception occurred processing JSP page … classFile.delete() failed
- The issue isn’t reproducible on demand.
- Potential business impact: all end users can be affected if publisher health isn’t restored promptly.
Cause
A race condition in the Apache Sling Scripting JSP module, triggered by memory pressure and SoftReference cache eviction, allows parallel threads to work on the same compiled JSP classes. This leads to instability and publisher health check failures.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review your AEM publisher error logs for exceptions related to JSP compilation and file deletion failures, as described above.
-
Confirm that the symptoms match those outlined (unhealthy publisher, health check failures, errors referencing
classFile.delete()in JSP processing). -
Determine your current AEM Service Pack version. The hotfix is available for AEM 6.5.24 and later. If you are on an earlier version, contact Adobe Support for guidance.
-
If you are on a supported version and the hotfix isn’t yet installed, open a support ticket with Adobe via the Experience League Support Portal. Include:
-
A description of the issue and relevant error log excerpts
-
Your current AEM version and Service Pack level
-
Confirmation that the issue matches the scenario described in this article
-
-
Once you receive the hotfix package from Adobe Support, use the AEM Package Manager to upload and install it on your publisher instances. Follow your organization’s change management and deployment procedures.
-
After installation, verify the following:
-
The
org.apache.sling.scripting.jspbundle is in the Active state in the OSGi console. -
The bundle version matches the one provided with the hotfix.
-
Only a single instance of the bundle is installed.
-
-
Monitor publisher health and error logs to confirm that the issue is resolved.
-
If the issue recurs after hotfix installation, collect new thread dumps, heap dumps, and error logs, and contact Adobe Support for further analysis.