Opening SCL Console can freeze UI during imported module initialization
When the database is busy and you try to open SCL Console, it will get stuck in setting initial imports if the imports contain modules from the database.
Thread [main] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.parkNanos(Object, long) line: 215
Semaphore$NonfairSync(AbstractQueuedSynchronizer).doAcquireSharedNanos(int, long) line: 1037
Semaphore$NonfairSync(AbstractQueuedSynchronizer).tryAcquireSharedNanos(int, long) line: 1328
Semaphore.tryAcquire(long, TimeUnit) line: 409
SessionImplDb(SessionImplSocket).acquire(Semaphore, T, P) line: 3442
SessionImplDb(SessionImplSocket).acquire(Semaphore, T) line: 3432
SessionImplDb(SessionImplSocket).syncRequest(Read<T>, AsyncProcedure<T>) line: 1868
SessionImplDb(SessionImplSocket).syncRequest(Read<T>, SyncListener<T>) line: 3003
GraphModuleSourceRepository.getModuleSource(String, UpdateListener) line: 51
ServiceBasedModuleSourceRepository.getModuleSource(String, UpdateListener) line: 33
ModuleRepository$ModuleEntry.initModuleEntryAndAddListener(UpdateListener) line: 138
ModuleRepository$ModuleEntry.access$0(ModuleRepository$ModuleEntry, UpdateListener) line: 137
ModuleRepository.getModuleEntry(String, UpdateListener) line: 254
ModuleRepository.getModuleEntries(CompilationContext, ImportDeclaration[], UpdateListener, boolean) line: 282
ModuleRepository.createRuntimeEnvironment(ImportDeclaration[], ClassLoader, UpdateListener) line: 394
ModuleRepository.createRuntimeEnvironment(EnvironmentSpecification, ClassLoader, UpdateListener) line: 384
CommandSession.updateRuntimeEnvironment(boolean) line: 115
CommandSession.setImportEntries(ArrayList<CommandSessionImportEntry>) line: 645
SCLConsoleView.setCurrentImports(ArrayList<CommandSessionImportEntry>) line: 110
SCLConsoleView.createPartControl(Composite) line: 268
CompatibilityView(CompatibilityPart).createPartControl(IWorkbenchPart, Composite) line: 151
CompatibilityView.createPartControl(IWorkbenchPart, Composite) line: 147
CompatibilityView(CompatibilityPart).create() line: 355
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
MethodRequestor.execute() line: 55
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 990
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 955
InjectorImpl.inject(Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 124
InjectorImpl.internalMake(Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 399
InjectorImpl.make(Class<T>, PrimaryObjectSupplier) line: 318
ContextInjectionFactory.make(Class<T>, IEclipseContext) line: 162
ReflectionContributionFactory.createFromBundle(Bundle, IEclipseContext, IEclipseContext, URI) line: 105
ReflectionContributionFactory.doCreate(String, IEclipseContext, IEclipseContext) line: 74
ReflectionContributionFactory.create(String, IEclipseContext) line: 56
ContributedPartRenderer.createWidget(MUIElement, Object) line: 129
PartRenderingEngine.createWidget(MUIElement, Object) line: 997
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 666
PartRenderingEngine$1.run() line: 551
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 535
ElementReferenceRenderer.createWidget(MUIElement, Object) line: 70
PartRenderingEngine.createWidget(MUIElement, Object) line: 997
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 666
PartRenderingEngine.safeCreateGui(MUIElement) line: 772
PartRenderingEngine.access$0(PartRenderingEngine, MUIElement) line: 743
PartRenderingEngine$2.run() line: 737
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement) line: 721
PartServiceImpl$1.handleEvent(Event) line: 109
UIEventHandler$1.run() line: 40
UISynchronizer(Synchronizer).syncExec(Runnable) line: 233
UISynchronizer.syncExec(Runnable) line: 144
Display.syncExec(Runnable) line: 4889
E4Application$1.syncExec(Runnable) line: 212
UIEventHandler.handleEvent(Event) line: 36
EventHandlerWrapper.handleEvent(Event, Permission) line: 201
EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197
EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1
EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230
ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148
EventAdminImpl.dispatchEvent(Event, boolean) line: 135
EventAdminImpl.sendEvent(Event) line: 78
EventComponent.sendEvent(Event) line: 39
EventBroker.send(String, Object) line: 52
UIEventPublisher.notifyChanged(Notification) line: 60
PartStackImpl(BasicNotifierImpl).eNotify(Notification) line: 374
PartStackImpl(ElementContainerImpl<T>).setSelectedElement(T) line: 173
StackRenderer$3.widgetSelected(SelectionEvent) line: 1053
TypedListener.handleEvent(Event) line: 249
EventTable.sendEvent(Event) line: 86
Display.sendEvent(EventTable, Event) line: 4428
CTabFolder(Widget).sendEvent(Event) line: 1079
CTabFolder(Widget).sendEvent(int, Event, boolean) line: 1103
CTabFolder(Widget).sendEvent(int, Event) line: 1088
CTabFolder(Widget).notifyListeners(int, Event) line: 802
CTabFolder.setSelection(int, boolean) line: 3187
CTabFolder.onMouse(Event) line: 1870
CTabFolder.lambda$0(Event) line: 328
0000000032D2AC40.handleEvent(Event) line: not available
EventTable.sendEvent(Event) line: 86
Display.sendEvent(EventTable, Event) line: 4428
CTabFolder(Widget).sendEvent(Event) line: 1079
Display.runDeferredEvents() line: 4238
Display.readAndDispatch() line: 3817
PartRenderingEngine$5.run() line: 1155
Realm.runWithDefault(Realm, Runnable) line: 336
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 1044
E4Workbench.createAndRunUI(MApplicationElement) line: 153
Workbench.lambda$3(Display, WorkbenchAdvisor, int[]) line: 680
0000000015254F20.run() line: not available
Realm.runWithDefault(Realm, Runnable) line: 336
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 594
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 148
SimanticsWorkbenchApplication.start(IApplicationContext) line: 156
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 134
EclipseAppLauncher.start(Object) line: 104
EclipseStarter.run(Object) line: 388
EclipseStarter.run(String[], Runnable) line: 243
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
Main.invokeFramework(String[], URL[]) line: 653
Main.basicRun(String[]) line: 590
Main.run(String[]) line: 1499
Main.main(String[]) line: 1472
Again, move the import initialization to a job.
Edited by Tuukka Lehtonen