lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DIGY" <digyd...@gmail.com>
Subject RE: Unit test TestIndexWithThreads fails
Date Wed, 19 Sep 2007 20:09:52 GMT

With the modification below, I can now regenerate the exception
"System.SystemException: Internal error: 2 deleted 0 documents, term=id:38".

Using "lock(idStack)" seems to solve the problem.

delId = idStack[idStack.Count - 1] as System.String;
int xx = idStack.Count - 1; 
System.Threading.Thread.Sleep(10); //***** Let another thread run.
idStack.RemoveAt(xx);


DIGY

-----Original Message-----
From: George Aroush [mailto:george@aroush.net] 
Sent: Wednesday, September 19, 2007 10:02 PM
To: lucene-net-dev@incubator.apache.org
Subject: RE: Unit test TestIndexWithThreads fails

Hi DIGGY,

Tonight, I will attempt to reproduce this on two of my machines; one is
hyper-threaded and the other is 2 CPU Xeon.  Then I will apply the patch and
observe the results.

If anyone else got a 2+ CPU machine and can test too, please do so.

Regards,

-- George

> -----Original Message-----
> From: DIGY [mailto:digydigy@gmail.com] 
> Sent: Wednesday, September 19, 2007 2:35 PM
> To: lucene-net-dev@incubator.apache.org
> Subject: RE: Unit test TestIndexWithThreads fails
> 
> Hi,
> 
> Access to static idStack field in 
> IndexThread(TestIndexModifier.cs) is not synchronized. That 
> may be the reason. 
> 
> i can not test it , since i am not able to reproduce the error.
> 
> DIGY
> 
> - idStack.Add(doc.Get("id"));
> + lock (idStack)
> + {
> +	idStack.Add(doc.Get("id"));
> + }
> 
> 
> - delId = idStack[idStack.Count - 1] as System.String;
> - idStack.RemoveAt(idStack.Count - 1);
> + lock (idStack)
> + {
> +  	 delId = idStack[idStack.Count - 1] as System.String;
> +      idStack.RemoveAt(idStack.Count - 1); }
> 
> -----Original Message-----
> From: Granroth, Neal V. [mailto:neal.granroth@thermofisher.com]
> Sent: Tuesday, September 18, 2007 7:03 PM
> To: lucene-net-dev@incubator.apache.org
> Subject: Unit test TestIndexWithThreads fails
> 
> Has anyone else encountered problems with unit test 
> "TestIndexModifier.TestIndexWithThreads" using the current source SVN?
> 
> I encounter this exception:
> 
> An unhandled exception was detected. Since it was most likely 
> thrown on a separate thread, it may or may not have been 
> caused by the current test.
> 
> System.SystemException: Internal error: 2 deleted 0 
> documents, term=id:38
>    at Lucene.Net.Index.IndexThread.Run() in 
> F:\Lucene-dev2\Test\Index\TestIndexModifier.cs:line 325
>    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>    at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
>    at System.Threading.ThreadHelper.ThreadStart()
> 
> 
> If I change the thead affinity of NUnit before starting the 
> tests, forcing the tests to be run only a single CPU, this 
> exception does not occur.
> 
> 
> -- Neal
> 
> 


Mime
View raw message