-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Itermittent NPE in remove #76
Comments
This is using 3.0.0 |
Can you please give me a reproducible code? The region from where it is throwing is as follows: for (Document document : cursor) {
NitriteId nitriteId = document.getId();
indexingService.removeIndexEntry(document, nitriteId);
Document removed = underlyingMap.remove(nitriteId);
int rev = removed.getRevision(); <<< NPE It means that So I am curious why is it happening. My initial assumption is, you are removing the document from a different thread and it is hitting a race condition. So If you could give me a reproducible code it would be better for me to dig down and take proper measure. |
Hi Anindya, I am thinking the same thing as you... However, the problem is
very hard to reproduce. Was hoping you could just write some defensive
code for this case.
…On Wed, May 30, 2018 at 3:18 AM, Anindya Chatterjee < ***@***.***> wrote:
Can you please give me a reproducible code? The region from where it is
throwing is as follows:
for (Document document : cursor) {
NitriteId nitriteId = document.getId();
indexingService.removeIndexEntry(document, nitriteId);
Document removed = underlyingMap.remove(nitriteId);
int rev = removed.getRevision(); <<< NPE
It means that nitriteId is not there in the underlyingMap, but the
nitriteId is obtained from a document iterating the cursor which is
generated from the same underlyingMap.
So I am curious why is it happening. My initial assumption is, you are
removing the document from a different thread and it is hitting a race
condition. So If you could give me a reproducible code it would be better
for me to dig down and take proper measure.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#76 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoz9_0y9m_icqKvDrxK5ZSzlUk9KEb2ks5t3ke0gaJpZM4USExO>
.
|
@cpotter1 can you test the latest snapshot now? - 3.0.1-SNAPSHOT |
In DataService, on line 227, seeing this problem periodically.
java.lang.NullPointerException
at org.dizitart.no2.internals.DataService.remove(DataService.java:228)
at org.dizitart.no2.internals.NitriteService.remove(NitriteService.java:372)
at org.dizitart.no2.internals.DefaultNitriteCollection.remove(DefaultNitriteCollection.java:360)
at org.dizitart.no2.internals.DefaultNitriteCollection.remove(DefaultNitriteCollection.java:349)
at
Looks like you are not checking for null on "removed" before calling getRevision:
Document removed = underlyingMap.remove(nitriteId);
int rev = removed.getRevision();
The text was updated successfully, but these errors were encountered: