This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37580 - Deadlock during editing of JSP on PVCS filesystem
Summary: Deadlock during editing of JSP on PVCS filesystem
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: -S1S-
Hardware: PC All
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-27 18:06 UTC by Marek Fukala
Modified: 2004-04-20 11:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (13.68 KB, text/plain)
2003-11-27 18:12 UTC, Marek Fukala
Details
.StringIndexOutOfBoundsException (7.67 KB, patch)
2004-04-20 09:38 UTC, Peter Pis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2003-11-27 18:06:34 UTC
[S1S5 rc7 + striker patches]
I had mounted a PVCS/Webmodule filesystem and tried to edit a non writable JSP file. Just after I hit the keyboard the IDE froze. Threaddump is attached.
Comment 1 Marek Fukala 2003-11-27 18:12:09 UTC
Created attachment 12337 [details]
Thread dump
Comment 2 Martin Entlicher 2003-11-27 20:05:22 UTC
Well, this is actually a problem in vcscore module => moving to
vcscore.

The first thing is, that FileObject.lock() is called in AWT thread.
This is not really nice, but it seems it's not forbidden.

The next thing is, that you had to type in *very* fast (at least 3
times) Enter into the Editor:
One Enter key made an attempt to modify a file. This has created a
confirmation dialog, that ask you whether you want to get a writable
file. This dialog was confirmed immediately by the second Enter, but
then another Enter was trying to modify the file.

This leads to deadlock in VcsFileSystem.lock() method. It waits in a
lock until the EDIT command is customized, but in the mean time lock()
method was entered again in AWT thread and waited on the lock. Because
this is in AWT, the command customization could never proceed.

I was able to reproduce this state.
1) Either you will type Enter into Editor very fast at least 4-5 times
2) Or you will simply press Enter and let the keyboard repeater do the
work.
Comment 3 Martin Entlicher 2003-11-28 16:53:20 UTC
The solution can be to reduce the synchronization on the map of
running EDIT and LOCK commands. This synchronization was created to
assure that the user will not get multiple questions while the command
is still running. But there seems to be a lock for that also in
CloneableEditorSupport.
Comment 4 Martin Entlicher 2003-11-28 17:55:49 UTC
Just to track the history of this problem:
This deadlock is caused by the fix of issue #23407 - waiting for other
EDIT and LOCK commands to finish.
Comment 5 Martin Entlicher 2003-12-01 10:55:13 UTC
See also issue #37596 for the problem of calling VcsFileSystem.lock()
and UserQuestionException.confirmed() in AWT thread. If these calls
are combined, you get this deadlock.

I'll concentrate on issue #37596 first.
Comment 6 Martin Entlicher 2003-12-03 11:36:22 UTC
The problem is fixed in the main trunk. VcsFileSystem.lock() method
was refactored, there's less synchronization now:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.239; previous revision: 1.238
Comment 7 Peter Pis 2004-04-20 09:38:46 UTC
Created attachment 14471 [details]
.StringIndexOutOfBoundsException
Comment 8 Peter Pis 2004-04-20 10:00:12 UTC
The attachment doesn't belong to this issue.
Comment 9 Peter Pis 2004-04-20 11:07:15 UTC
Verified in

NetBeans 3.6
NetBeans IDE Dev (Build 200404191800)