You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2021/10/17 15:13:25 UTC

[GitHub] [lucenenet] NightOwl888 opened a new pull request #525: Fixes Lucene.Net.Index.TestIndexWriter::TestThreadInterruptDeadlock() and Lucene.Net.Index.TestIndexWriter::TestTwoThreadsInterruptDeadlock()

NightOwl888 opened a new pull request #525:
URL: https://github.com/apache/lucenenet/pull/525


   This fixes `Lucene.Net.Index.TestIndexWriter::TestThreadInterruptDeadlock()` and `Lucene.Net.Index.TestIndexWriter::TestTwoThreadsInterruptDeadlock()` as well as sporadic deadlocks we were getting when doing a complete test run.
   
   The issue is that .NET considers any wait state (including waiting on a lock) to be a valid condition for throwing a `System.Threading.ThreadInterruptedException`. This makes it difficult to deal with this exception because it is not necessarily thrown when the application is in a known consistent state. The workaround was to replace all `lock` statements in the solution with a new `UninterruptableMonitor` class. This class handles the exceptions that .NET throws and, if they occur, resets `Thread.CurrentThread.Interrupt()` to put the thread back into the same state it was at the beginning of the method. This is not a complete solution, though, because we may interrupt on code that we don't own such as one of the dependencies or user injected code (such as a custom Directory implementation). A more complete solution will be needed for the release, but this is still a big improvement over the last release.
   
   This PR also includes the changes from #511 and thus supersedes it.
   
   In addition, we have removed the `[Deadlock]` attribute from several tests and the `[AwaitsFix]` attribute from the tests in the title.
   
   


-- 
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-unsubscribe@lucenenet.apache.org

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



[GitHub] [lucenenet] NightOwl888 merged pull request #525: Fixes Lucene.Net.Index.TestIndexWriter::TestThreadInterruptDeadlock() and Lucene.Net.Index.TestIndexWriter::TestTwoThreadsInterruptDeadlock()

Posted by GitBox <gi...@apache.org>.
NightOwl888 merged pull request #525:
URL: https://github.com/apache/lucenenet/pull/525


   


-- 
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-unsubscribe@lucenenet.apache.org

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