NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #2014 (closed defect: moved)

Opened 2013-10-17T14:45:49-05:00

Last modified 2013-10-17T16:36:48-05:00

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 2013-10-17T14:47:05-05:00 by bdezonia

  • Blocking 1457 added

comment:2 Changed 2013-10-17T16:02:22-05:00 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 2013-10-17T16:36:48-05:00 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 2013-10-17T16:41:04-05:00 by bdezonia

comment:4 Changed 2014-05-06T09:41:34-05:00 by curtis

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