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

Shorten dot input in case of TimeOutException #8

Open
lemmy opened this issue Sep 6, 2017 · 5 comments
Open

Shorten dot input in case of TimeOutException #8

lemmy opened this issue Sep 6, 2017 · 5 comments

Comments

@lemmy
Copy link

lemmy commented Sep 6, 2017

When the dot process (com.abstratt.graphviz.GraphViz.runDot(String...)) runs into a TimeOutException due to an excessive size of the dot input, the full input is attached to the IStatus (com.abstratt.graphviz.GraphViz.logInput(ByteArrayOutputStream)) and subsequently printed to the console (com.abstratt.imageviewer.AbstractGraphicalContentProvider.ContentLoader.run(IProgressMonitor)).

Instead, in case of a TimeOutException only attach an excerpt of the dot input to IStatus. The root cause for the TimeOutException is likely to be caused by the excessive size of the dot input.

@abstratt
Copy link
Owner

abstratt commented Sep 6, 2017

@lemmy Can you add more info to make it obvious to anyone why the current behaviour is problematic?

@lemmy
Copy link
Author

lemmy commented Sep 6, 2017

The behaviour is problematic because it clutters the log with several thousand lines of dot input. If additionally one happens to print the log to Eclipse's console, it can crash the IDE with a heap overflow.

@abstratt
Copy link
Owner

abstratt commented Sep 6, 2017

Thanks, quite compelling when you put it like that!

@abstratt
Copy link
Owner

abstratt commented Sep 6, 2017

@lemmy Few questions for you:

  1. Have you tried running dot against the large input via command line? Does it really take longer than 1 minute (current threshold)? How long does it take (on your setup)?
  2. If so, maybe we should raise the timeout threshold in EclipseGraphviz?
  3. If not, then I'd rather investigate why EclipseGraphviz takes longer to run Graphviz than via command-line (sorry, not really a question)
  4. How long is the DOT string that is causing the error?
  5. Is it generated by you, or some other tool (like the TextUML Toolkit)?
  6. Shouldn't we limit the dot input string that is logged in the case of error always, no matter the cause was a timeout or not?

@lemmy
Copy link
Author

lemmy commented Sep 6, 2017

  1. markus@avocado:~/src/TLA/EWD840.toolbox/Model_3$ time dot -Tpdf Model_3.dot > Model_3.pdf
    ^C
    real 32m4.793s
    user 32m0.840s
    sys 0m0.520s

It's a state graph with a few thousand nodes.

  1. markus@avocado:~/src/TLA/EWD840.toolbox/Model_3$ wc -l Model_3.dot
    14059 Model_3.dot

  2. The DOT string is generated by TLC - an explicit state model checker

  3. Not sure

By the way, I'm aware that visualizing a graph with more than a few dozen nodes make little sense anyway. However, Graphviz shouldn't crash the Eclipse IDE if one is so stupid to actually try and show such a graph in the image viewer.

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

2 participants