NightOwl888 opened a new issue, #841:
URL: https://github.com/apache/lucenenet/issues/841

   Per the [dispose pattern 
docs](https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern):
   
   > ✓ DO allow the Dispose(bool) method to be called more than once. The 
method might choose to do nothing after the first call.
   >
   > X AVOID throwing an exception from within Dispose(bool) except under 
critical situations where the containing process has been corrupted (leaks, 
inconsistent shared state, etc.).
   
   `NRTCachingDirectory` violates both of these rules by throwing an 
`ObjectDisposedException` the second time `Dispose()` 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:
   
   <RunSettings>
   <TestRunParameters>
   <Parameter name="tests:seed" value="0xc6267c4598373666" />
   <Parameter name="tests:culture" value="gd" />
   </TestRunParameters>
   </RunSettings>
   
   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](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net%2FStore%2FBaseDirectory.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=77&lineEnd=78&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Store.RAMDirectory.ListAll() in 
/_/src/Lucene.Net/Store/RAMDirectory.cs:line 
123](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net%2FStore%2FRAMDirectory.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=123&lineEnd=124&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Store.NRTCachingDirectory.Dispose(Boolean disposing) in 
/_/src/Lucene.Net/Store/NRTCachingDirectory.cs:line 
362](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net%2FStore%2FNRTCachingDirectory.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=362&lineEnd=363&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Store.MockDirectoryWrapper.Dispose(Boolean disposing) in 
/_/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs:line 
1108](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net.TestFramework%2FStore%2FMockDirectoryWrapper.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=1108&lineEnd=1109&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Store.Directory.Dispose() in 
/_/src/Lucene.Net/Store/Directory.cs:line 
134](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net%2FStore%2FDirectory.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=134&lineEnd=135&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Index.TestIndexWriterOnJRECrash.CheckIndexes(FileSystemInfo 
file) in /_/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs:line 
324](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net.Tests%2FIndex%2FTestIndexWriterOnJRECrash.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=324&lineEnd=325&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   [at Lucene.Net.Index.TestIndexWriterOnJRECrash.TestNRTThreads_Mem() in 
/_/src/Lucene.Net.Tests/Index/TestIndexWriterOnJRECrash.cs:line 
87](https://dev.azure.com/lucene-net-temp2/Lucene.NET/_git/0bfcbd04-4e65-4b34-99ee-7c81708a4f07?path=%2F_%2Fsrc%2FLucene.Net.Tests%2FIndex%2FTestIndexWriterOnJRECrash.cs&version=GBfeature%2Frandomizedtesting-2.7.8.1-alpha-0008&_a=contents&line=87&lineEnd=88&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, 
Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, 
BindingFlags invokeAttr)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to