NRTCachingDirectory doesn't allow double dispose calls #841
Labels
design
is:bug
is:enhancement
New feature or request
pri:high
up-for-grabs
This issue is open to be worked on by anyone
Per the dispose pattern docs:
NRTCachingDirectory
violates both of these rules by throwing anObjectDisposedException
the second timeDispose()
is called. We need to be careful about how to fix this and ensure the usage pattern will work after the fix has been applied.System.ObjectDisposedException : this Directory is disposed.
Object name: 'Lucene.Net.Store.RAMDirectory'.
To reproduce this test result:
Option 1:
Apply the following assembly-level attributes:
[assembly: Lucene.Net.Util.RandomSeed("0xc6267c4598373666")]
[assembly: NUnit.Framework.SetCulture("gd")]
Option 2:
Use the following .runsettings file:
See the .runsettings documentation at: https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file.
at Lucene.Net.Store.BaseDirectory.EnsureOpen() in /_/src/Lucene.Net/Store/BaseDirectory.cs:line 77
at Lucene.Net.Store.RAMDirectory.ListAll() in /_/src/Lucene.Net/Store/RAMDirectory.cs:line 123
at Lucene.Net.Store.NRTCachingDirectory.Dispose(Boolean disposing) in /_/src/Lucene.Net/Store/NRTCachingDirectory.cs:line 362
at Lucene.Net.Store.MockDirectoryWrapper.Dispose(Boolean disposing) in /_/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs:line 1108
at Lucene.Net.Store.Directory.Dispose() in /_/src/Lucene.Net/Store/Directory.cs:line 134
at Lucene.Net.Index.TestIndexWriterOnJRECrash.CheckIndexes(FileSystemInfo file) in /_/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs:line 324
at Lucene.Net.Index.TestIndexWriterOnJRECrash.TestNRTThreads_Mem() in /_/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs:line 87
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
The text was updated successfully, but these errors were encountered: