Lucene.Net.Replicator Bug Fixes (Fixes #363) #534
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 subclassThreadJob
which handles re-throwing any unhandled exception when callingJoin()
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 usingReplicationService
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.