Detecting stacktrace image - IllegalStateException: Timeout4 TIMEOUT

0 votes
asked Jul 23, 2019 in Bug by krasa (820 points)
edited Jul 23, 2019 by krasa

I interrupt the rendering thread, when an user requests a different diagram while rendering. It used to work fine, or maybe it still does in some cases, but sometimes it returns this image: https://imgur.com/a/LxmZSJ2

There is no way to detect if it is an stacktrace image or what. Description returned from `SourceStringReader#outputImage` contains only: "(0 entities)".

It would be nice if the Description contained the exception instance or even the whole text, so I can just ignore that image - not cache it, and properly log/report the exception.

Also it seems to me that it should not be a TIMEOUT.

This could probably be fixed: https://github.com/plantuml/plantuml/blob/2c655a6b7481c39a41fc0dc57b561bd1db1ecfe2/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java#L73-L87

So to sum it up, there are 2 issues

- not being able to detect the stacktrace error image

- incorrect timeout detection due to InterruptedException

...

java.lang.IllegalStateException: Timeout4 TIMEOUT

at net.sourceforge.plantuml.svek.DotStringFactory.getSvg(DotStringFactory.java:307)

at net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(GeneralImageBuilder.java:199)

at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:105)

at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:71)

at net.sourceforge.plantuml.cucadiagram.CucaDiagram.exportDiagramInternal(CucaDiagram.java:385)

at net.sourceforge.plantuml.classdiagram.ClassDiagram.exportDiagramInternal(ClassDiagram.java:199)

at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:202)

at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)

at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:154)

at org.plantuml.idea.rendering.PlantUmlNormalRenderer.generateImageItem(PlantUmlNormalRenderer.java:218)

at org.plantuml.idea.rendering.PlantUmlNormalRenderer.normalRendering(PlantUmlNormalRenderer.java:171)

at org.plantuml.idea.rendering.PlantUmlNormalRenderer.doRender(PlantUmlNormalRenderer.java:131)

at org.plantuml.idea.rendering.PlantUmlRendererUtil.render(PlantUmlRendererUtil.java:74)

at org.plantuml.idea.rendering.RenderCommand.run(RenderCommand.java:66)

at org.plantuml.idea.rendering.LazyApplicationPoolExecutor$1.run(LazyApplicationPoolExecutor.java:121)

at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)

at java.util.concurrent.FutureTask.run(FutureTask.java)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

@startuml
legend
Notes:
    To add new function please review this diagram in conjunction with `add_new_functions.md` file
end legend
@enduml

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...