AnsweredAssumed Answered

Endless loop with transformation options

Question asked by rivarola on Aug 11, 2015
Hello,

I have defined asynchronous rules in Alfresco to create PDF and image transformations for all inbound documents.
It works well but the server CPU reaches summits, the server gets slow and seems stuck.
A jstack on the java process shows several threads involved in transformations, with many recursive calls to TransformationOptionPair methods :
<blockquote>
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:207)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:207)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:207)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:229)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:207)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimitValue(TransformationOptionPair.java:242)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:207)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMax(TransformationOptionPair.java:206)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getMaxValue(TransformationOptionPair.java:249)
   at org.alfresco.service.cmr.repository.TransformationOptionPair$1.getLimit(TransformationOptionPair.java:228)
   at org.alfresco.service.cmr.repository.TransformationOptionPair.getValue(TransformationOptionPair.java:104)
   at org.alfresco.repo.content.AbstractContentReader.getContentInputStream(AbstractContentReader.java:384)
   at org.alfresco.repo.content.AbstractContentReader.getContent(AbstractContentReader.java:431)
   at org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker.transform(AbstractImageMagickContentTransformerWorker.java:246)
   at sun.reflect.GeneratedMethodAccessor470.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at com.sun.proxy.$Proxy19.transform(Unknown Source)
   at org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:77)
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:238)
   at org.alfresco.repo.content.transform.ComplexContentTransformer.transformInternal(ComplexContentTransformer.java:486)
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:238)
   at org.alfresco.repo.content.transform.FailoverContentTransformer.transformInternal(FailoverContentTransformer.java:201)
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:238)
   at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:625)
</blockquote>

These are not really endless loops, because I get not stack overflow, but the server gets damn slow when 3 or 4 threads get stuck in this kind of stack.

Any idea of what happens?

PS : I use Alfresco 4.2-b on MySQL

Outcomes