Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario in Ditaa that "hangs" PlantUML #1036

Closed
Potherca opened this issue Jun 10, 2022 · 4 comments
Closed

Scenario in Ditaa that "hangs" PlantUML #1036

Potherca opened this issue Jun 10, 2022 · 4 comments

Comments

@Potherca
Copy link

Potherca commented Jun 10, 2022

There is a scenario when using Ditaa that causes PlantUML to "hang".

I have reduced this case to a minimum example:

@startditaa
=-
@endditaa

The online server gives: 504 Gateway Time-out The server didn't respond in time.

To reproduce locally, run:

 echo -e '@startditaa\n=-\n@endditaa' | java -jar /usr/local/share/plantuml.jar -pipe -verbose

This will give the following output:

(0.000 - 244 Mo) 237 Mo - SecurityProfile LEGACY
(0.003 - 244 Mo) 237 Mo - PlantUML Version 1.2022.5
(0.003 - 244 Mo) 237 Mo - GraphicsEnvironment.isHeadless() false
(0.004 - 244 Mo) 237 Mo - Forcing resource load on OpenJdk
(1.129 - 244 Mo) 232 Mo - Reading from string
(1.243 - 244 Mo) 228 Mo - Compilation duration 5
(1.244 - 244 Mo) 228 Mo - Regex total/invoked/compiled 0/0/0
(1.244 - 244 Mo) 228 Mo - Matches created 0

The CPU goes to 100% and the process just keeps running.
It doesn't crash but it also doesn't time-out. (I gave up after 90 minutes...)

Compared to a normal run:

$ echo -e '@startditaa\n--\n@endditaa' | java -jar /usr/local/share/plantuml.jar -pipe -verbose
(0.000 - 244 Mo) 237 Mo - SecurityProfile LEGACY
(0.002 - 244 Mo) 237 Mo - PlantUML Version 1.2022.5
(0.002 - 244 Mo) 237 Mo - GraphicsEnvironment.isHeadless() false
(0.002 - 244 Mo) 237 Mo - Forcing resource load on OpenJdk
(1.200 - 244 Mo) 231 Mo - Reading from string
(1.281 - 244 Mo) 227 Mo - Compilation duration 2
(1.282 - 244 Mo) 227 Mo - Regex total/invoked/compiled 0/0/0
(1.282 - 244 Mo) 227 Mo - Matches created 0
�PNG
�
IHDR<'`�}IDATx^��1
�0EA]F����4n�S��#��r�o|64��6�>������������������˜s������^�~�����������������M�FDWN'��9��IEND�B`

I have verified that this case does work with the latest rlease of ditaa (0.11).

Running this:

 java -jar /opt/ditaa-0.11.0-standalone.jar <(echo '-=') /dev/stdout 

gives the following output:

ditaa version 0.11, Copyright (C) 2004--2017  Efstathios (Stathis) Sideris

Running with options:
Reading file: /dev/fd/63
Rendering to file: /dev/stdout
�PNG
�
IHDR<'`�{IDATx^��1
�0EA�\7w��`D:�G3�.�x㳡�>v�y���DWDWDWDWDWDWDWDWDWDWDWDWDWDWDWD_���{��g^�~����������������ʏ荈��2��7x���IEND�B`�Done in 1sec
@soloturn
Copy link
Contributor

soloturn commented Jun 12, 2022

as i was confused what the output of line and dotted line should be, i tried:

java -jar /tmp/ditaa-0.11.0-standalone.jar <(echo '-------================-----') /tmp/t1.png

and ditta makes it dotted:

t1

arnaudroques added a commit that referenced this issue Jun 27, 2022
@arnaudroques
Copy link
Contributor

Thanks for the report.
This issue seems to be on Ditaa code side.
We simply don't know how to fix it :-)

So maybe you can open an issue on Ditaa (not sure that this is possible).

However, we did implement a workaround to avoid infinite loop.

This is far from perfect but at least it protects against the timeout.

Sorry we could not do better!

@Potherca
Copy link
Author

As this usecase does work with the ditaa JAR, I asume it has something to do with the integration side of things?

@arnaudroques Do you have any details on how/where the issue lies with the Ditaa code?

So maybe you can open an issue on Ditaa (not sure that this is possible).

Ditaa is currently in a state of limbo. The original author has stated they are no longer in a position to maintain the project but a new maintainer has not (yet) been found.

@Potherca
Copy link
Author

Closing this as the original issue is resolved by 649a13e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants