Ticket #2014 (closed defect: moved)

Opened 6 years ago

Last modified 6 years ago

Verify that services dispose in similar order to initialization

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

Description

I was under the impression that when disposing the Context the services are closed in reverse order of their opening. However looking at the log entries and printing which services are closing you can see they close in a much different order. This may be an effect of the console timing but it may not. Make sure that services are closing in a safe orderly fashion.

Change History

comment:1 Changed 6 years ago by bdezonia

  • Blocking 1457 added

comment:2 Changed 6 years ago by bdezonia

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

I have confirmed that the order of initialization and destruction are definitely different. The ServiceIndex is populated in the correct initialization order. However internally that class does not maintain the order since it is a SortedObjectIndex. So the call in Context::dispose() that walks the services in reverse order can't really know the correct order. Perhaps I am missing something. ctrueden can you comment on this?

comment:3 Changed 6 years ago by bdezonia

I've kludged up a hacky fix that shows how to make things close in reverse order. Surprisingly this seems to close correctly avoiding exceptions that gave rise to ticket #2013. That fact may be irrelevant. Anyhow the code is on the service-dispose-hack branch of scijava-common. This "fix" needs to be made into something more correct.

Last edited 6 years ago by bdezonia (previous) (diff)

comment:4 Changed 5 years ago by curtis

  • Status changed from reviewing to closed
  • Resolution set to moved
Note: See TracTickets for help on using tickets.