Open hinerm opened 9 years ago
@ctrueden Did I get anything wrong here?
Looks good, I think.
The culprit is this line of code in the DefaultEventBus. The rationale for the change (6b878da41160da695f6552ee86f537cff2443faf) was performance, but unfortunately it comes at the expense of correctness. We will probably have to revert that commit to fix things.
The
DefaultEventBus
is making poor choices in where to publish events.publish
method publishes to the EDT. Thus if the result of this publish tries to do something on the EDT it will deadlock.publishLater
method usesThreadService.run
, which runs on an arbitrary thread. Thus subsequentpublishLater
calls are not guaranteed to execute in a consistent order.To resolve this issue, we should have a dedicated SciJava event-processing thread which runs all
EventBus
publications.