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

BUG: Fix for DocumentsWriter concurrency (fixes #935, closes #886) #940

Merged

Commits on May 15, 2024

  1. Lucene.Net.Index.DocumentsWriterFlushControl: Reverted changes from 9…

    …63e10c that made the documents writer non-concurrent (but threadsafe)
    NightOwl888 committed May 15, 2024
    Configuration menu
    Copy the full SHA
    878261f View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. BUG: Lucene.Net.Index.DocumentsWriterFlushControl::AddFlushableState(…

    …): The DocumentsWriterThreadPool.Reset() method must be called within the context of a lock because there is a possible race condition with other callers of DocumentsWriterThreadPool.Reset(). See apache#935.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    23898ad View commit details
    Browse the repository at this point in the history
  2. BUG: Lucene.Net.Support.Threading.ReentrantLock: In Java, the Reentra…

    …ntLock.tryLock() method barges to the front of the queue instead of returning false like Monitor.TryEnter(). Use Monitor.Enter(object, ref bool) instead, which always returns true. We get locks in a different order, but I am not sure whether that matters. Fixes apache#935. Closes apache#886.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    a96fdf8 View commit details
    Browse the repository at this point in the history
  3. Lucene.Net.Index.TestRollingUpdates::TestUpdateSameDoc(): Added [Repe…

    …at(1000)] to try to reproduce on Azure DevOps (to be reverted).
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    e3501a3 View commit details
    Browse the repository at this point in the history
  4. Lucene.Net.Index.DocumentsWriterPerThreadPool: Removed MinContendedTh…

    …readState() method because it has no callers. This simplifies the design of ReentrantLock, since we don't need to artificially keep track of "queued threads".
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    3abbb73 View commit details
    Browse the repository at this point in the history
  5. Lucene.Net.Support: Added aggressive inlining for ReentrantLock and U…

    …ninterruptableMonitor on cascaded methods.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    0884f4d View commit details
    Browse the repository at this point in the history
  6. run-tests-on-os.yml: Increase blame hang timeout so we can run a long…

    …er test (to be reverted)
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    bbd6726 View commit details
    Browse the repository at this point in the history
  7. Lucene.Net.Support.Threading.ReentrantLock: Use TryEnter() instead of…

    … Enter(). Enter() causes deadlocks in other tests, so need to localize this change to DocumentsWriterFlushControl.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    37a0521 View commit details
    Browse the repository at this point in the history
  8. Lucene.Net.Index.DocumentsWriterFlushControl::InternalTryCheckoutForF…

    …lush(): Use ReentrantLock.Lock() instead of ReentrantLock.TryLock() because Java relies on "barging" behavior instead of returning false when the current thread isn't next in the queue. We cannot do that, but we can wait for the lock to become available instead.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    be17a95 View commit details
    Browse the repository at this point in the history
  9. Lucene.Net.Support.Threading.ReeentrantLock(): Added an overload of T…

    …ryLock() that accepts a timeout (TimeSpan)
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    f33b243 View commit details
    Browse the repository at this point in the history
  10. Lucene.Net.Index.DocumentsWriterFlushControl: Use timeouts to allow s…

    …ome time for threads to reach the beginning of the wait queue. In Java, they are automatically put at the beginning of the queue, but since we cannot do that in .NET, we wait a little bit.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    85d8023 View commit details
    Browse the repository at this point in the history
  11. Lucene.Net.Index.DocumentsWriterFlushControl: Base the number of mill…

    …iseconds to wait on whether the current process is 64 or 32 bit.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    61bf4ac View commit details
    Browse the repository at this point in the history
  12. Lucene.Net.Index::DocumentsWriter: Added a constant TryLockTimeoutMil…

    …liseconds that is used by callers of ReentrantLock.TryLock() to set the default value.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    6f2e129 View commit details
    Browse the repository at this point in the history
  13. Lucene.Net.Support: Added QueueExtensions class to polyfill the missi…

    …ng TryDequeue() and TryPeek() methods on netstandard2.0 and .NET Framework
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    d18d9b7 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    8423edc View commit details
    Browse the repository at this point in the history
  15. Lucene.Net.Support.Threading.ReentrantLock: Changed the implementatio…

    …n to use unfair locking similar to how it was done in Java. We track the queue and use ManualResetEventSlim to control entry into the lock for queued tasks. Ported some of the ReentrantLock tests from Apache Harmony.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    89b01e6 View commit details
    Browse the repository at this point in the history
  16. Revert "Lucene.Net.Support: Added QueueExtensions class to polyfill t…

    …he missing TryDequeue() and TryPeek() methods on netstandard2.0 and .NET Framework"
    
    This reverts commit e5a65e9cd8bbf996fb599ff76e8d6b9f90babe4b.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    3074564 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e788218 View commit details
    Browse the repository at this point in the history
  18. Lucene.Net.Support.Threading.ReentrantLock::Lock(): Use Uninterruptab…

    …leMonitor.TryEnter() instead of UninterruptableMonitor.Enter() so we can control what happens while the thread waits. We simply call Thread.Yield() to allow TryLock() to proceed before any waiting threads. Commented tests that depend on IsLocked because the property was removed.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    ce7516d View commit details
    Browse the repository at this point in the history
  19. Revert "run-tests-on-os.yml: Increase blame hang timeout so we can ru…

    …n a longer test (to be reverted)"
    
    This reverts commit b30e4abb576c8bfde3337a92de927a10747f88ae.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    53b83c2 View commit details
    Browse the repository at this point in the history
  20. Revert "Lucene.Net.Index.TestRollingUpdates::TestUpdateSameDoc(): Add…

    …ed [Repeat(1000)] to try to reproduce on Azure DevOps (to be reverted)."
    
    This reverts commit d8fca410dafd1bf5529e8200034e1e2e5be83f07.
    NightOwl888 committed May 23, 2024
    Configuration menu
    Copy the full SHA
    5f7c1e9 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. Lucene.Net.Support.Threading.ReentrantLockTest::TestUnlock_IllegalMon…

    …itorStateException() Removed unused exception variable and added a comment to indicate success so we don't have to suppress warnings
    NightOwl888 committed May 24, 2024
    Configuration menu
    Copy the full SHA
    4e1dcc9 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Lucene.Net.Support.Threading.UninterruptableMonitor: Elminated RetryE…

    …nter() recursive methods to avoid overflowing the stack and moved the logic into the catch blocks. Also added documentation.
    NightOwl888 committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    d1c0762 View commit details
    Browse the repository at this point in the history