Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » [Policy]┬áInvalid thread access with force restart
[Policy] Invalid thread access with force restart [message #631924] Sun, 10 October 2010 13:35
Christophe Fondacci is currently offline Christophe Fondacci
Messages: 95
Registered: July 2009
Location: Paris
Member
Hello all,

Working with 3.6.1, got an invalid thread access using the RESTART_POLICY_FORCE. After a few tests, I think it comes from the P2 framework which should do a sync or async exec before calling platform restart.

The problematic method is ProvisioningOperationRunner.requestRestart(int). In this method we could see that no synch is made with a RESTART_POLICY_FORCE, while synch is made when prompting user. Since this method is called by a job listener, it fires invalid thread access exception.

No big deal since it is ok for me to prompt the users. But I would like to know if I should file a bug or if there is any known workaround ?

Here's the stack I get :
!ENTRY org.eclipse.ui.workbench 4 2 2010-10-10 19:09:51.719
!MESSAGE Erreurs lors de l'appel du code du plug-in : org.eclipse.ui.workbench.
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:4083)
        at org.eclipse.swt.SWT.error(SWT.java:3998)
        at org.eclipse.swt.SWT.error(SWT.java:3969)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:715)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:532)
        at org.eclipse.swt.widgets.Shell.getMaximized(Shell.java:910)
        at org.eclipse.ui.internal.WorkbenchWindow.saveState(WorkbenchWindow.java:2643)
        at org.eclipse.ui.internal.Workbench.saveState(Workbench.java:2679)
        at org.eclipse.ui.internal.Workbench.recordWorkbenchState(Workbench.java:2210)
        at org.eclipse.ui.internal.Workbench.access$11(Workbench.java:2207)
        at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1077)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1075)
        at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:1032)
        at org.eclipse.ui.internal.Workbench$25.run(Workbench.java:1276)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:52)
        at org.eclipse.ui.internal.Workbench.close(Workbench.java:1274)
        at org.eclipse.ui.internal.Workbench.restart(Workbench.java:2231)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner.requestRestart(ProvisioningOperationRunner.java:76)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner.access$0(ProvisioningOperationRunner.java:71)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner$2.done(ProvisioningOperationRunner.java:128)
        at org.eclipse.core.internal.jobs.JobListeners$3.notify(JobListeners.java:39)
        at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:112)
        at org.eclipse.core.internal.jobs.JobListeners.done(JobListeners.java:152)
        at org.eclipse.core.internal.jobs.JobManager.endJob(JobManager.java:647)
        at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:105)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:71)

!ENTRY org.eclipse.equinox.p2.ui 4 2 2010-10-10 19:09:51.725
!MESSAGE Erreurs lors de l'appel du code du plug-in : org.eclipse.equinox.p2.ui.
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:The dialog should be created in UI thread
        at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
        at org.eclipse.jface.dialogs.IconAndMessageDialog.getSWTImage(IconAndMessageDialog.java:282)
        at org.eclipse.jface.dialogs.IconAndMessageDialog.getQuestionImage(IconAndMessageDialog.java:260)
        at org.eclipse.jface.dialogs.MessageDialog.<init>(MessageDialog.java:189)
        at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:360)
        at org.eclipse.jface.dialogs.MessageDialog.openQuestion(MessageDialog.java:463)
        at org.eclipse.ui.internal.Workbench$17.handleException(Workbench.java:1092)
        at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:75)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:44)
        at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1075)
        at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:1032)
        at org.eclipse.ui.internal.Workbench$25.run(Workbench.java:1276)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:52)
        at org.eclipse.ui.internal.Workbench.close(Workbench.java:1274)
        at org.eclipse.ui.internal.Workbench.restart(Workbench.java:2231)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner.requestRestart(ProvisioningOperationRunner.java:76)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner.access$0(ProvisioningOperationRunner.java:71)
        at org.eclipse.equinox.internal.p2.ui.ProvisioningOperationRunner$2.done(ProvisioningOperationRunner.java:128)
        at org.eclipse.core.internal.jobs.JobListeners$3.notify(JobListeners.java:39)
        at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:112)
        at org.eclipse.core.internal.jobs.JobListeners.done(JobListeners.java:152)
        at org.eclipse.core.internal.jobs.JobManager.endJob(JobManager.java:647)
        at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:105)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:71)



Thank you,
Christophe.
http://www.nextep-softwares.com

Previous Topic:Temporary Repo Location
Next Topic:P2 Agent not found when running P2-installer
Goto Forum:
  


Current Time: Fri Aug 29 12:35:58 EDT 2014

Powered by FUDForum. Page generated in 0.01507 seconds