ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

IOC list blank #2161

Closed Tom-Willemsen closed 7 years ago

Tom-Willemsen commented 7 years ago

Sometimes when I start the GUI the IOC list is blank. This is inconsistent and not easily reproducable but has occured 3 times in 30 minutes in a development environment (between myself and Adrian's PCs).

Add some logging to this area to check which PVs or observables are blank to try and debug this.

image

When the GUI is in this state, you also can't edit the current configuration. It throws the following exception when you try to edit the current configuration:

!ENTRY org.eclipse.ui 4 0 2017-03-07 10:12:00.617
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
    at uk.ac.stfc.isis.ibex.ui.configserver.commands.helpers.EditConfigHelper.openDialog(EditConfigHelper.java:57)
    at uk.ac.stfc.isis.ibex.ui.configserver.commands.helpers.ConfigHelper.createDialogCurrent(ConfigHelper.java:45)
    at uk.ac.stfc.isis.ibex.ui.configserver.commands.EditCurrentConfigHandler.execute(EditCurrentConfigHandler.java:89)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
    at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
    at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at uk.ac.stfc.isis.ibex.product.Application.start(Application.java:40)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
*2017-03-07 10:12:00.617 [main] ERROR org.eclipse.ui.workbench - null
    uk.ac.stfc.isis.ibex.ui.configserver.commands.helpers.EditConfigHelper.openDialog(EditConfigHelper.java:57)
    uk.ac.stfc.isis.ibex.ui.configserver.commands.helpers.ConfigHelper.createDialogCurrent(ConfigHelper.java:45)
    uk.ac.stfc.isis.ibex.ui.configserver.commands.EditCurrentConfigHandler.execute(EditCurrentConfigHandler.java:89)
    org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
    org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
    org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
    org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
    org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
    org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    uk.ac.stfc.isis.ibex.product.Application.start(Application.java:40)
    org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    org.eclipse.equinox.launcher.Main.main(Main.java:1414)
AdrianPotter commented 7 years ago

You will know immediately if this state has been triggered at startup because the Dashboard will report Setup state but the current configuration will be Unknown

AdrianPotter commented 7 years ago

Seems to be caused by ticket #1752. I checked out the gui branch from before the change and couldn't subsequently reproduce the issue.

John-Holt-Tessella commented 7 years ago

Maybe the line 71 in c.stfc.isis.ibex.epics/src/uk/ac/stfc/isis/ibex/epics/observing/ForwardingObservable.java which was deleted:

this.source = newSource;

Write failing test and then fix. If this is the cause

Tom-Willemsen commented 7 years ago

Commits where this bug definitely appears: 02b6533 3cd5578 b530fc6 (Ticket 2048 latest) 0e1d894 (Ticket 2048 merge commit)

Commits which I've tested and couldn't reproduce the bug 42835c0 (One merge commit before 2048 was merged) d793126 (on Ticket 2048 branch) a06059c (on Ticket 2048 branch) a9a4ab0

Tom-Willemsen commented 7 years ago

Comments above about not being able to edit current configuration are not necessarily always true. My GUI was in a state where I could see/edit the current configuration but the IOC list was blank.

I edited my current configuration's description while in that state, and then my IOCs came back as expected (although the blockserver did take a long time to update, ~30 seconds or so).

Tom-Willemsen commented 7 years ago

#2165 will contain a temporary fix.

Temporary fix in #2165 did not fix this issue.

Tom-Willemsen commented 7 years ago

This is not reproducible enough to be fixable at this stage.

Steps to reproduce:

  1. Start your instrument so that you would expect to have some IOCs available to start
  2. Open a gui
  3. Go to IOC -> Start/stop IOCs
  4. Notice that sometimes, the IOC list is completely blank and you can't edit the current configuration. You may need to restart the GUI many times (around 50-100) before you see this behaviour.

This bug can only be attacked properly once we have a reliable way of reproducing it.

I've put a pull request in which I think reduces the frequency of this bug happening...

Tom-Willemsen commented 7 years ago

@DominicOram suggested a few more places to add logging so I will try those.

Tom-Willemsen commented 7 years ago

I've added some logging on PVManager so that if someone reproduces this bug we'll know whether it ever connected or not.

Tom-Willemsen commented 7 years ago

There is now a follow-up ticket #2199 for this issue! Please file any reoccurences of this bug on that ticket.