Ticket #1973 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Event processing can hang

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b8-analysis
Component: Analysis Plugins Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1457

Description

Recently the event processing was changed to accommodate some needs with status area updates. Now you can hang things by doing this:

open boats
Add Data to X (like 25 pixels)

Debugger shows multiple threads blocked on each other

Change History

comment:1 Changed 6 years ago by hinerm

  • Owner changed from hinerm to bdezonia
  • Status changed from new to reviewing

Note that this occurs because of the dataset view being rebuilt on the EDT, which ultimately leads to autoscale -> computeMinMax on the EDT, which tries to send status updates back to the EDT, which deadlocks. This would be an issue for any computation called during rebuilding that would display its own status updates.

This issue should be fixed in  this commit.

DatasetView/display rebuilds should now occur off the EDT.

I had to add a null check in the SwingDisplayPanel because the first time it redraws the computation may not be complete, thus the projector is null. But after rebuilding another event is dispatched and the display panel redraws correctly.

I didn't see any other UI implementations of the ImageDisplayPanel, but those would need a similar check.

bdezonia, can you verify this works on your end?

comment:2 Changed 6 years ago by bdezonia

  • Owner changed from bdezonia to hinerm

As things didn't work here I am reassigning to hinerm

comment:3 Changed 6 years ago by hinerm

  • Owner changed from hinerm to bdezonia

Specifically, adding a channel to an RGB image was causing exceptions due to the timing of the rebuild methods.

As of  this commit the rebuilds are now synchronized on the context, which leads to the correct execution order and seemed to fix the error on my end.

bdezonia please test again to confirm.

comment:4 Changed 6 years ago by bdezonia

  • Status changed from reviewing to closed
  • Resolution set to fixed

Appears to be working. Closing.

Note: See TracTickets for help on using tickets.