| Summary: | [e4] "EventAdmin Async Event Dispatcher Thread" can be blocked by a UI thread | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> | ||||
| Component: | Incubator | Assignee: | Project Inbox <rap.incubator-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | ||||||
| Version: | 3.1 | ||||||
| Target Milestone: | 3.2 M3 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: | https://git.eclipse.org/r/#/c/84011 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 265052 [details]
e4 demo patch
This is a patch in order to reproduce the issue with our e4 demo. Open a dialog in APP_STARTUP_COMPLETE event handler in the first UI session will stop the async event dispatching in others. Once the dialog is closed, all async queued events are dispatched at once.
Fixed with change https://git.eclipse.org/r/#/c/84011/ |
Sending event asynchronously (using (RAP)EventBroker#post) can lead to a blocked "EventAdmin Async Event Dispatcher Thread". As a result asynchronous events in all UI session will not be dispatched anymore (till the dispatcher thread is unblocked by the blocking UI thread). Here is the explanation. Dispatching events asynchronously uses a singleton EventAdmin platform service. This service is shared between all UI sessions. In order to deliver the events to the corresponding UI session only, the event topic is prefixed by the workbench instance id. This is done in the RAP port of the EventBroker - RAPEventBroker#rapifyTopic. Asynchronous events (sent by (RAP)EventBroker#post) are using the same instance of EventAdmin service, EventManager and EventThread in all UI sessions. All async events (in all UI sessions) are dispatched by the same EventThread ("EventAdmin Async Event Dispatcher Thread"). Synchronizing back to the UI thread is done unfortunately in a synchronous way by UISynchronize#syncExec - see RAPUIEventObjectSupplier#UIEventHandler#handleEvent and RAPUIEventHandler#handleEvent. Blocking one UI thread in the event handler will block the EventThread. Probably for an RCP application this is expected - events should not be dispatched till UI thread is blocked. In multiuser environment like RAP, blocking EventThread from one UI session will affect all other UI sessions.