Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File handle not released when loading h5 data fails #168

Open
k-dominik opened this issue Sep 30, 2024 · 0 comments
Open

File handle not released when loading h5 data fails #168

k-dominik opened this issue Sep 30, 2024 · 0 comments

Comments

@k-dominik
Copy link

k-dominik commented Sep 30, 2024

Problem

When investigating #167 I found that Fiji seems to keep the file handle to an hdf5 file open if loading the data is not successful. Obviously the handle should be closed when an error occurs. Not sure this is in the hands of this library or somwhere deep in fiji/imagej. This happens with the Open Multiple Images and Labels and Open Image and Labels.

To reproduce

  • Use the h5 file from this zip cr.zip
  • In Fiji Plugins -> MoBiE -> Open Multiple Images and Labels
  • add this file as the first image and open
  • it fails 🐛
  • lsof | grep cr.h5 to confirm file is still opened in Fiji
traceback
[ERROR] Command errored: Open Multiple Images and Labels...
java.lang.RuntimeException: java.lang.IllegalArgumentException: provided axes doesn't match dimensionality of image
	at org.embl.mobie.io.imagedata.IlastikImageData.open(IlastikImageData.java:141)
	at org.embl.mobie.io.imagedata.IlastikImageData.getMetadata(IlastikImageData.java:106)
	at org.embl.mobie.lib.data.ImageGridSources.setMetadata(ImageGridSources.java:188)
	at org.embl.mobie.lib.data.ImageGridSources.<init>(ImageGridSources.java:91)
	at org.embl.mobie.lib.data.GridSourcesFromPathsCreator.<init>(GridSourcesFromPathsCreator.java:51)
	at org.embl.mobie.MoBIE.<init>(MoBIE.java:169)
	at org.embl.mobie.command.open.OpenMultipleImagesAndLabelsCommand.run(OpenMultipleImagesAndLabelsCommand.java:103)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.IllegalArgumentException: provided axes doesn't match dimensionality of image
	at org.embl.mobie.io.imagedata.IlastikImageData.splitIntoChannels(IlastikImageData.java:201)
	at org.embl.mobie.io.imagedata.IlastikImageData.open(IlastikImageData.java:134)
	... 15 more
@k-dominik k-dominik changed the title File handle not released when loading data fails File handle not released when loading h5 data fails Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant