You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2017/12/08 14:47:00 UTC
[jira] [Resolved] (SLING-7291) HTL to Java compilation might fail
under heavy load
[ https://issues.apache.org/jira/browse/SLING-7291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Radu Cotescu resolved SLING-7291.
---------------------------------
Resolution: Fixed
Fixed in [757534c|github.com/apache/sling-org-apache-sling-scripting-sightly/commit/757534c].
> HTL to Java compilation might fail under heavy load
> ---------------------------------------------------
>
> Key: SLING-7291
> URL: https://issues.apache.org/jira/browse/SLING-7291
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Affects Versions: Scripting HTL Engine 1.0.20
> Reporter: Radu Cotescu
> Assignee: Radu Cotescu
> Priority: Minor
> Fix For: Scripting HTL Engine 1.0.46
>
>
> When there's a high number of concurrent threads accessing the same HTL script that needs to be compiled, compilation might fail since these threads try to write to the same file-system based file.
> In the end the script will be compiled correctly since the HTL engine will retry the operation until a valid Java class is generated, however this should be avoided with a simple locking mechanism.
> See the following stack trace:
> {noformat}
> 05.12.2017 13:28:13.424 *ERROR* [<removed> [1512509292912] GET <removed> HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
> java.lang.ClassFormatError: Truncated class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at org.apache.sling.commons.fsclassloader.impl.FSDynamicClassLoader.loadClass(FSDynamicClassLoader.java:58)
> at org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:166)
> at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.internalCompile(SightlyScriptEngine.java:149)
> at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptEngine.java:80)
> at org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider.provide(RenderUnitProvider.java:127)
> at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:73)
> at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:69)
> at org.apache.sling.scripting.sightly.<removed>
> at org.apache.sling.scripting.sightly.java.compiler.RenderUnit.render(RenderUnit.java:48)
> at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:61)
> at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)
> at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
> at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
> at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)