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

Lucene.Net.Replicator Bug Fixes (Fixes #363) #534

Merged
merged 9 commits into from
Nov 7, 2021

Conversation

NightOwl888
Copy link
Contributor

This fixes several issues with Lucene.Net.Replicator.

Failing Intermittently

  • Lucene.Net.Replicator.Http.HttpReplicatorTest::TestBasic()

This was failing due to the Timeout value being set to 1 second instead of the 60 second value that was used in Java. It has been increased to the .NET default of 100 seconds.

Fixes #363

Failing Intermittently & Deadlocking Intermittently

  • Lucene.Net.Replicator.IndexAndTaxonomyReplicationClientTest::TestConsistencyOnExceptions()
  • Lucene.Net.Replicator.IndexReplicationClientTest::TestConsistencyOnExceptions()

These were failing due to the fact that they were throwing exceptions on the worker thread, which causes it to stop immediately when they are unhandled. The Lucene.Net.Replicator.ReplicationClient.ReplicationThread class was re-ported from Lucene 4.8.1 to subclass ThreadJob which handles re-throwing any unhandled exception when calling Join() on the thread.

There were also 4 methods that were missing locks in Lucene.Net.Replicator.ReplicationClient that likely explains why we were getting deadlocks.

The rest of the replicator changes were also ported from Lucene 4.8.1, and ReplicatorTestCase was set up to use a .NET 5 example using ReplicationService as middleware with its own endpoint mapping, which allows other routes to be handled elsewhere rather than being the only termination point.

The throw statements and catch blocks were also reviewed to make sure we aren't swallowing exceptions we shouldn't be.

…t from 1000 ms to 100 s. Renamed DEFAULT_CONNECTION_TIMEOUT to DEFAULT_TIMEOUT and ConnectionTimeout property to Timeout to match HttpClient. Fixes apache#363.
… and dispose the stream when there are no more bytes to read.
…so exceptions are re-thrown on the calling thread. Added missing locks.
…InputStream() overloads GetResponseStream() per .NET conventions.
…tes, since changing to a ThreadJob implementation in ReplicationClient has resolved the issues with both TestConsistencyOnExceptions() tests
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

Successfully merging this pull request may close these issues.

Investigate Failing Test: Lucene.Net.Replicator.Http.HttpReplicatorTest::TestBasic()
1 participant