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

Periodic open specification hangs (possible fundamental Editor concurrency issue in all versions) #392

Closed
yawlfoundation opened this issue Jul 29, 2015 · 5 comments

Comments

@yawlfoundation
Copy link
Owner

With Editor V2.1beta, I periodically get fatal hangs when trying to open a 
specification. I've captured the exception (which is inside Swing); see 
attached STDERR output.

It *appears* (after some investigation) that this is because the JFileChooser 
that the archiving thread kicks off is not invoked from the event dispatch 
thread as all Swing components should be (and it being a concurrency issue 
explains why it is sporadic). See:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6637181

http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/concurrency
/dispatch.html

In particular, see the FileChooserDemo.java from the official Sun 
FileChooserDemo:

http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/examples/co
mponents/index.html#FileChooserDemo

Note that, even for a basic JFileChooser, SwingUtilities.invokeLater is used to 
invoke all the GUI creation code on the event dispatch thread.

I'm not a Swing expert, but this would suggest that this might be a fundamental 
error in the entire Editor, since none of the initial GUI is set up via an 
invokeLater or invokeAndWait (only bits and pieces of non-central code use 
these methods if you search the Editor codebase). This would also apply for all 
previous versions, not just 2.1beta.

Hence setting this to Critical until someone can confirm or deny this. Hope 
that's OK!


Original issue reported on code.google.com by monsieur...@gmail.com on 14 Jul 2010 at 4:50

Attachments:

@yawlfoundation
Copy link
Owner Author

Perhaps that sounded a little hysterical :-)
(not in the funny way, though maybe that as well on reflection)

Re the wider critical scope, I just meant that I don't think the primary Editor 
Swing component(s) are instantiated from the Event Dispatch Thread either (so 
they could also be subject to potential concurrency errors). Obviously, once in 
place, they get events on this thread automatically, and so only any code 
explicitly using background threads 'thereafter' could run into concurrency 
problems.

Original comment by monsieur...@gmail.com on 16 Jul 2010 at 7:05

@yawlfoundation
Copy link
Owner Author

The real issue is that virtually none of the GUI code is explicitly launched in 
the EDT, and so requires a substantial rewrite - which will occur when the 
editor rebuild begins

Original comment by yawl.mic...@gmail.com on 20 Jul 2010 at 1:30

  • Changed state: Accepted

@yawlfoundation
Copy link
Owner Author

Just to confirm that this occurs very often for me nowadays; maybe one in 2 or 
3 times of using Open Specification. I therefore try to avoid it by using Open 
Recent, etc. where possible.

I guess I'm surprised that this doesn't happen for more people given the lack 
of EDT 'coordination' in the code. Maybe I'm just unlucky that the exact OS/JVM 
combination I have makes this more likely...

Original comment by monsieur...@gmail.com on 31 Aug 2010 at 3:37

@yawlfoundation
Copy link
Owner Author

Might be of interest (apologise if not):
http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html

One of the Sun Swing developers gives a neat summary of ways to 
programmatically debug EDT errors, including a very simple AspectJ 
implementation that will root out all should-have-been-called-on-the-EDT errors 
at runtime.

Original comment by monsieur...@gmail.com on 29 Sep 2010 at 3:11

@yawlfoundation
Copy link
Owner Author

resolved in editor 3.0

Original comment by yawl.mic...@gmail.com on 9 Dec 2013 at 2:43

Changed state: Fixed

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

No branches or pull requests

1 participant