Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328067

Summary: Deadlock during debugging
Product: [WebTools] WTP ServerTools Reporter: Angel Vera <arvera>
Component: wst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: critical    
Priority: P3 CC: arvera, ccc, daniel_megert, darin.eclipse, david_williams, hugg, john.arthorne, krzysztof.daniel, makandre, pwebster, Szymon.Brandys, tjbishop
Version: 3.2   
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/108996
Whiteboard:
Bug Depends on: 309781, 327247    
Bug Blocks:    
Attachments:
Description Flags
v1.0 none

Description Angel Vera CLA 2010-10-18 15:09:49 EDT
+++ This bug was initially created as a clone of Bug #327247 +++

+++ This bug was initially created as a clone of Bug #309781 +++

The following stacktrace is reported. The issue is caused by the fact that during the isCancelled, separate event loop is launched, and DebugPlugin tries to save modified editor again. 

Reproduction steps are for Eclipse based product, but they give pretty good insight into the situation:
1. Start WAS in Debug mode from RAD                                     
                                                                        
                                                                        
2. Develop a Dynamic Web project v 2.5 targeting WAS 7                  
                                                                        
3. Add a Servlet with a sysout in doGet                                 
                                                                        
4. Add the project to WAS                                               
                                                                        
5. Add a breakpoint inside doGet                                        
                                                                        
6. Debug the servlet so that it reaches the breakpoint                  
                                                                        
7. Click on the "bug" button in the debug view to restart the server in 
debug mode                                                              
                                                                        
7. while the server is restarting, add a new space char inside the doGet
method of the servlet.                                                  
                                                                        
If you do this while the server is still shutting down, then you can    
save the servlet.                                                       
                                                                        
If you wait until when the server has initiated the restart, then you   
cannot save the servlet.                                                
                                                                        
You see a progress dialog with three entries:                           
                                                                        
- Restarting WAS 7.0 server                                             
- Save                                                                  
- Starting WAS 7.0 server                                               
                                                                        
8. If you wait for some time (minutes) then you will get a dialog asking
if you want to save. Click OK                                           
                                                                        
9. Now RAD is still hanging, and you see in the progress dialog:        
                                                                        
Save                                                                    
Starting WAS                                                            
Building prerequisite project list                                      
                                                                        
However the server appears to be in started state.                      


at java/lang/Object.wait(Native Method) at java/lang/Object.wait(Bytecode PC:3(Compiled Code)) at org/eclipse/core/internal/jobs/ThreadJob.joinRun(Bytecode PC:277) at org/eclipse/core/internal/jobs/ImplicitJobs.begin(Bytecode PC:207) at org/eclipse/core/internal/jobs/JobManager.beginRule(Bytecode PC:16) at org/eclipse/core/internal/resources/WorkManager.checkIn(Bytecode PC:40) at org/eclipse/core/internal/resources/Workspace.prepareOperation(Bytecode PC:50) at org/eclipse/core/internal/resources/Workspace.run(Bytecode PC:39) at org/eclipse/ui/actions/WorkspaceModifyOperation.run(Bytecode PC:27) at org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.run(Bytecode PC:18) at org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.run(Bytecode PC:20) at org/eclipse/ui/editors/text/TextFileDocumentProvider.executeOperation(Bytecode PC:16) at org/eclipse/ui/editors/text/TextFileDocumentProvider.saveDocument(Bytecode PC:24) at org/eclipse/ui/texteditor/AbstractTextEditor.performSave(Bytecode PC:44) at org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.performSave(Bytecode PC:32) at org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.doSave(Bytecode PC:115) at org/eclipse/ui/texteditor/AbstractTextEditor$TextEditorSavable.doSave(Bytecode PC:7) at org/eclipse/ui/Saveable.doSave(Bytecode PC:2) at org/eclipse/ui/internal/SaveableHelper.doSaveModel(Bytecode PC:70) at org/eclipse/ui/internal/EditorManager$6.run(Bytecode PC:102) at org/eclipse/ui/internal/SaveableHelper$4.run(Bytecode PC:7) at org/eclipse/jface/operation/ModalContext.runInCurrentThread(Bytecode PC:8) at org/eclipse/jface/operation/ModalContext.run(Bytecode PC:48) at org/eclipse/jface/window/ApplicationWindow$1.run(Bytecode PC:19) at org/eclipse/swt/custom/BusyIndicator.showWhile(Bytecode PC:118) at org/eclipse/jface/window/ApplicationWindow.run(Bytecode PC:302) at org/eclipse/ui/internal/WorkbenchWindow.run(Bytecode PC:170) at org/eclipse/ui/internal/SaveableHelper.runProgressMonitorOperation(Bytecode PC:24) at org/eclipse/ui/internal/EditorManager.saveAll(Bytecode PC:676) at org/eclipse/ui/internal/Workbench$17.run(Bytecode PC:253) at org/eclipse/core/runtime/SafeRunner.run(Bytecode PC:7(Compiled Code)) at org/eclipse/ui/internal/Workbench.saveAllEditors(Bytecode PC:23) at org/eclipse/debug/internal/ui/DebugUIPlugin.saveAllEditors(Bytecode PC:14) at org/eclipse/debug/internal/ui/DebugUIPlugin.preLaunchSave(Bytecode PC:34) at org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.handleStatus(Bytecode PC:131) at org/eclipse/debug/internal/ui/sourcelookup/Prompter$1.run(Bytecode PC:19) at org/eclipse/ui/internal/UILockListener.doPendingWork(Bytecode PC:29) at org/eclipse/ui/internal/UISynchronizer$3.run(Bytecode PC:7) at org/eclipse/swt/widgets/RunnableLock.run(Bytecode PC:13(Compiled Code)) at org/eclipse/swt/widgets/Synchronizer.runAsyncMessages(Bytecode PC:29(Compiled Code)) at org/eclipse/swt/widgets/Display.runAsyncMessages(Bytecode PC:5(Compiled Code)) at org/eclipse/swt/widgets/Display.readAndDispatch(Bytecode PC:74(Compiled Code)) at org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.runEventLoop(Bytecode PC:39) at org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.isCanceled(Bytecode PC:1) at org/eclipse/core/runtime/ProgressMonitorWrapper.isCanceled(Bytecode PC:6(Compiled Code)) at org/eclipse/core/runtime/SubMonitor$RootInfo.isCanceled(Bytecode PC:6(Compiled Code)) at org/eclipse/core/runtime/SubMonitor.isCanceled(Bytecode PC:4(Compiled Code)) at org/eclipse/core/internal/jobs/ThreadJob.isCanceled(Bytecode PC:3) at org/eclipse/core/internal/jobs/ThreadJob.joinRun(Bytecode PC:84) at org/eclipse/core/internal/jobs/ImplicitJobs.begin(Bytecode PC:207) at org/eclipse/core/internal/jobs/JobManager.beginRule(Bytecode PC:16) at org/eclipse/core/internal/resources/WorkManager.checkIn(Bytecode PC:40) at org/eclipse/core/internal/resources/Workspace.prepareOperation(Bytecode PC:50) at org/eclipse/core/internal/resources/Workspace.run(Bytecode PC:39) at org/eclipse/ui/actions/WorkspaceModifyOperation.run(Bytecode PC:27) at org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.run(Bytecode PC:18) at org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.run(Bytecode PC:20) at org/eclipse/ui/editors/text/TextFileDocumentProvider.executeOperation(Bytecode PC:16) at org/eclipse/ui/editors/text/TextFileDocumentProvider.saveDocument(Bytecode PC:24) at org/eclipse/ui/texteditor/AbstractTextEditor.performSave(Bytecode PC:44) at org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.performSave(Bytecode PC:32) at org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.doSave(Bytecode PC:115) at org/eclipse/ui/texteditor/AbstractTextEditor$TextEditorSavable.doSave(Bytecode PC:7) at org/eclipse/ui/Saveable.doSave(Bytecode PC:2) at org/eclipse/ui/internal/SaveableHelper.doSaveModel(Bytecode PC:70) at org/eclipse/ui/internal/SaveableHelper$2.run(Bytecode PC:84) at org/eclipse/ui/internal/SaveableHelper$4.run(Bytecode PC:7) at org/eclipse/jface/operation/ModalContext.runInCurrentThread(Bytecode PC:8) at org/eclipse/jface/operation/ModalContext.run(Bytecode PC:48) at org/eclipse/jface/window/ApplicationWindow$1.run(Bytecode PC:19) at org/eclipse/swt/custom/BusyIndicator.showWhile(Bytecode PC:118) at org/eclipse/jface/window/ApplicationWindow.run(Bytecode PC:302) at org/eclipse/ui/internal/WorkbenchWindow.run(Bytecode PC:170) at org/eclipse/ui/internal/SaveableHelper.runProgressMonitorOperation(Bytecode PC:24) at org/eclipse/ui/internal/SaveableHelper.runProgressMonitorOperation(Bytecode PC:4) at org/eclipse/ui/internal/SaveableHelper.saveModels(Bytecode PC:83) at org/eclipse/ui/internal/SaveableHelper.savePart(Bytecode PC:176) at org/eclipse/ui/internal/EditorManager.savePart(Bytecode PC:7) at org/eclipse/ui/internal/WorkbenchPage.savePart(Bytecode PC:7) at org/eclipse/ui/internal/WorkbenchPage.saveEditor(Bytecode PC:4) at org/eclipse/ui/internal/SaveAction.run(Bytecode PC:71) at org/eclipse/jface/action/Action.runWithEvent(Bytecode PC:1) at org/eclipse/jface/action/ActionContributionItem.handleWidgetSelection(Bytecode PC:356) at org/eclipse/jface/action/ActionContributionItem.access$2(Bytecode PC:3) at org/eclipse/jface/action/ActionContributionItem$6.handleEvent(Bytecode PC:60) at org/eclipse/swt/widgets/EventTable.sendEvent(Bytecode PC:216(Compiled Code)) at org/eclipse/swt/widgets/Widget.sendEvent(Bytecode PC:25(Compiled Code)) at org/eclipse/swt/widgets/Display.runDeferredEvents(Bytecode PC:84(Compiled Code)) at org/eclipse/swt/widgets/Display.readAndDispatch(Bytecode PC:59(Compiled Code)) at org/eclipse/ui/internal/Workbench.runEventLoop(Bytecode PC:9(Compiled Code)) at org/eclipse/ui/internal/Workbench.runUI(Bytecode PC:393) at org/eclipse/ui/internal/Workbench.access$4(Bytecode PC:1) at org/eclipse/ui/internal/Workbench$5.run(Bytecode PC:23) at org/eclipse/core/databinding/observable/Realm.runWithDefault(Bytecode PC:14) at org/eclipse/ui/internal/Workbench.createAndRunWorkbench(Bytecode PC:18) at org/eclipse/ui/PlatformUI.createAndRunWorkbench(Bytecode PC:2) at org/eclipse/ui/internal/ide/application/IDEApplication.start(Bytecode PC:84) at org/eclipse/equinox/internal/app/EclipseAppHandle.run(Bytecode PC:137) at org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.runApplication(Bytecode PC:105) at org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.start(Bytecode PC:29) at org/eclipse/core/runtime/adaptor/EclipseStarter.run(Bytecode PC:149) at org/eclipse/core/runtime/adaptor/EclipseStarter.run(Bytecode PC:183) at sun/reflect/NativeMethodAccessorImpl.invoke0(Native Method) at sun/reflect/NativeMethodAccessorImpl.invoke(Bytecode PC:83) at sun/reflect/DelegatingMethodAccessorImpl.invoke(Bytecode PC:6) at java/lang/reflect/Method.invoke(Bytecode PC:163) at org/eclipse/equinox/launcher/Main.invokeFramework(Bytecode PC:211) at org/eclipse/equinox/launcher/Main.basicRun(Bytecode PC:114) at org/eclipse/equinox/launcher/Main.run(Bytecode PC:4) at org/eclipse/equinox/launcher/Main.main(Bytecode PC:10)
Comment 1 Angel Vera CLA 2010-10-27 16:45:40 EDT
Created attachment 181881 [details]
v1.0
Comment 2 Angel Vera CLA 2010-10-27 16:48:49 EDT
Changes committed to 32M
Comment 3 Angel Vera CLA 2010-10-27 16:49:12 EDT
Changes released to 32M
Comment 4 Angel Vera CLA 2010-10-27 16:52:59 EDT
Changes committed to HEAD(3.3)
Comment 5 Angel Vera CLA 2010-10-27 16:54:09 EDT
Changes released to HEAD(3.3)
Comment 6 Angel Vera CLA 2011-02-09 16:33:52 EST
*** Bug 316213 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2017-10-11 16:34:53 EDT
New Gerrit change created: https://git.eclipse.org/r/108996