lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Nistor (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3066) NullPointerException when calling sizeInBytes and setHasVectors concurrently.
Date Tue, 03 May 2011 23:03:03 GMT


Adrian Nistor commented on LUCENE-3066:

Hi Michael,

Thanks for the super fast reply!

> SegmentInfo is not actually thread safe; access to it inside Lucene is 
> supposed to be guarded by IndexWriter's monitor lock.

Ah, very sorry, I did not realize this.

> That said, this issue looks a lot like LUCENE-3051 - is that where/how you hit 
> a problem here? Or something else...?

No, totally unrelated. I am testing a tool for testing concurrent code. I 
assumed that SegmentInfo is supposed to be thread safe and thus a good candidate 
for testing.

Thanks again for your reply and very sorry the trouble!



> NullPointerException when calling sizeInBytes and setHasVectors concurrently.
> -----------------------------------------------------------------------------
>                 Key: LUCENE-3066
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: java 1.6.0_24 
> Ubuntu 10.10
>            Reporter: Adrian Nistor
>         Attachments:
> Hi,
> I am encountering a NullPointerException when using 
> org.apache.lucene.index.SegmentInfo. It appears in version 3.1.0 and also in 
> revision 1099085 (May 3rd 2011).
> The NullPointerException is thrown by SegmentInfo.sizeInBytes(false) when 
> calling SegmentInfo.sizeInBytes(false) and SegmentInfo.setHasVectors(true) in 
> parallel. When these methods are called sequentially, they do not throw any 
> exception.
> I have attached a test that exposes this problem. If you set ExposeBug = true,
> the methods are called concurrently and you get the NullPointerException. If you
> set  ExposeBug = false, the methods are called sequentially, and there is no
> exception. Note that, in the sequential version, the methods are called many
> times (just like in the parallel version), and in different orders (just like
> in the parallel version).
> The concurrent test (ExposeBug = true) always throws NullPointerException 
> under heavy load (ManyIterations = 100000000). Under small load (e.g., if you
> set ManyIterations = 10), the NullPointerException will not manifest. I suppose
> you need a certain thread interleaving for the NullPointerException to happen,
> and thus you need the heavy load.
> Is this a bug? Is there a patch for it?
> Thanks!
> Adrian

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message