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

Deadlock on undo #15

Closed
iloveeclipse opened this issue Apr 19, 2022 · 1 comment · Fixed by #16
Closed

Deadlock on undo #15

iloveeclipse opened this issue Apr 19, 2022 · 1 comment · Fixed by #16
Assignees
Milestone

Comments

@iloveeclipse
Copy link
Member

After updating to I20220414-0120 we see crashes in our automated tests.
The crash is caused by an extra workspace rule taken on beginning of the undo operation, see https://github.com/eclipse-platform/eclipse.platform.ui/pull/6/files#r852668795
The undo task in question itself wants to begin the rule and waits now forever:

OperationHistoryActionHandler locked the workspace bbefore starting undo:

"main" #1 prio=6 os_prio=0 cpu=1336038.52ms elapsed=8612.16s tid=0x00007ffff001a800 nid=0x6ca9 runnable  [0x00007ffff5420000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS.Call(Native Method)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:5655)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:167)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:368)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:470)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:230)
	at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:984)
	at com.advantest.itee.testflow.core.edit.engine.WriteUtil.executeWriteBack(WriteUtil.java:456)
	at com.advantest.itee.testflow.core.edit.UndoRedoOperation.undo(UndoRedoOperation.java:97)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:407)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1149)
	at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:86)
	at org.eclipse.ui.operations.OperationHistoryActionHandler.lambda$0(OperationHistoryActionHandler.java:293)
	at org.eclipse.ui.operations.OperationHistoryActionHandler$$Lambda$3012/0x0000000842334440.run(Unknown Source)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:470)
	at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.access$1(TimeTriggeredProgressMonitorDialog.java:1)
	at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.lambda$0(TimeTriggeredProgressMonitorDialog.java:155)
	at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog$$Lambda$3014/0x0000000842333040.run(Unknown Source)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
	at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:167)
	at org.eclipse.ui.operations.OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:322)

Undo code tries to lock the workspace:

"ModalContext" #38513 prio=6 os_prio=0 cpu=0.22ms elapsed=951.45s tid=0x00007ffef9426800 nid=0xb5ab in Object.wait()  [0x00007fff28e70000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.10/Native Method)
	- waiting on <no object reference available>
	at java.lang.Object.wait(java.base@11.0.10/Object.java:328)
	at org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob.java:322)
	- waiting to re-lock in wait() <0x000000104a48b9b0> (a java.lang.Object)
	at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:208)
	at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:95)
	at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:311)
	at com.advantest.itee.testflow.core.edit.engine.WriteUtil.executeWriteOperation(WriteUtil.java:403)
	at com.advantest.itee.testflow.core.edit.engine.WriteUtil$2.run(WriteUtil.java:459)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
iloveeclipse added a commit to iloveeclipse/eclipse.platform.ui that referenced this issue Apr 19, 2022
Reverted commit d610ff2 as it caused
deadlock during undo if the undo operation also wants to use workspace
rule.

This fixes issue
eclipse-platform#15
iloveeclipse added a commit to iloveeclipse/eclipse.platform.ui that referenced this issue Apr 19, 2022
Reverted commit d610ff2 as it caused
deadlock during undo if the undo operation also wants to use workspace
rule.

This fixes issue
eclipse-platform#15
iloveeclipse added a commit that referenced this issue Apr 19, 2022
Reverted commit d610ff2 as it caused
deadlock during undo if the undo operation also wants to use workspace
rule.

This fixes issue
#15
@mickaelistria
Copy link
Contributor

This is now resolved.

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

Successfully merging a pull request may close this issue.

3 participants