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 99939

Summary: Potential race condition in thread interruption
Product: versioncontrol Reporter: Petr Nejedly <pnejedly>
Component: SubversionAssignee: issues@versioncontrol <issues>
Status: VERIFIED FIXED    
Severity: blocker Keywords: THREAD
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Petr Nejedly 2007-04-04 10:07:21 UTC
ui.status.VersioningPanel keeps reference to assigned RequestProcessor thread
and calls interrupt() on it. It also clear the reference to it asynchronously
(invokeLater) so there is a vulnerability window, where the RP's thread may
already been used by another task, yet VersioningPanel keeps its reference and
can interrupt() it. This would cause problems described in issue 98606.

Now, even if the correctness is enforced by the surrounding code, it is
unnecessarily complicated. RequestProcessor supports thread interruption (@since
openide-util,v6.3)
Just use "new RequestProcessor("SubversionView", 1, true);" and call cancel() on
the Task, it will unschedule it and interrupt() the assigned thread iff it is
currently running.
Comment 1 Tomas Stupka 2007-04-04 10:47:37 UTC
*** Issue 99211 has been marked as a duplicate of this issue. ***
Comment 2 Tomas Stupka 2007-04-11 09:17:11 UTC
fixed 


Checking in ui/wizards/importstep/ImportStep.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/ui/wizards/importstep/ImportStep.java,v
 <--  ImportStep.java
new revision: 1.36; previous revision: 1.35
done
Checking in ui/wizards/repositorystep/RepositoryStep.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/ui/wizards/repositorystep/RepositoryStep.java,v
 <--  RepositoryStep.java
new revision: 1.42; previous revision: 1.41
done
Checking in ui/status/VersioningPanel.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/ui/status/VersioningPanel.java,v
 <--  VersioningPanel.java
new revision: 1.35; previous revision: 1.34
done
Checking in client/Bundle.properties;
/cvs/subversion/main/src/org/netbeans/modules/subversion/client/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.14; previous revision: 1.13
done
Checking in client/WizardStepProgressSupport.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/client/WizardStepProgressSupport.java,v
 <--  WizardStepProgressSupport.java
new revision: 1.4; previous revision: 1.3
done
Checking in client/SvnProgressSupport.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/client/SvnProgressSupport.java,v
 <--  SvnProgressSupport.java
new revision: 1.19; previous revision: 1.18
done
Checking in ui/history/DiffResultsView.java;
/cvs/subversion/main/src/org/netbeans/modules/subversion/ui/history/DiffResultsView.java,v
 <--  DiffResultsView.java
new revision: 1.10; previous revision: 1.9
done
Comment 3 Petr Nejedly 2007-04-11 10:09:15 UTC
Looks great to me.