lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-818) IndexWriter should detect when it's used after being closed
Date Sun, 04 Mar 2007 01:43:50 GMT


Yonik Seeley commented on LUCENE-818:

> Yikes. Is this the Java memory model issue?

Yes, but it's not a problem with the Java memory model, it's more of a feature.  Threads in
general have this problem (or perform very poorly if they don't).  It's also very much about
compiler optimizations as well.  The optimizer may stuff a value in a register, and never
check it's location in main-memory, and never see the changes.  Even if it doesn't then you
drop down to problems with the CPU and cache + memory architectue in SMP systems.  Some systems
require explicit memory barriers or cache flushes to see memory changes from another CPU.
 One CPU writes to a spot in memory, and absent any special instructions, another CPU reading
from that spot in memory may not see the change.

> IndexWriter should detect when it's used after being closed
> -----------------------------------------------------------
>                 Key: LUCENE-818
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.1
>            Reporter: Michael McCandless
>         Assigned To: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-818.patch, LUCENE-818.take2.patch
> Spinoff from this thread on java-user:
> If you call addDocument on IndexWriter after it's closed you'll hit a
> hard-to-explain NullPointerException (because the RAMDirectory was
> closed).  Before 2.1, apparently you won't hit any exception and the
> IndexWrite will keep running but will have released it's write lock (I
> think).
> I plan to fix IndexWriter methods to throw an IllegalStateException if
> it has been closed.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message