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
SOLR-15983: synchronise LogUpdateProcessor's members use #597
Conversation
@@ -108,7 +108,9 @@ public void processAdd(AddUpdateCommand cmd) throws IOException { | |||
// Add a list of added id's to the response | |||
if (adds == null) { | |||
adds = new ArrayList<>(); | |||
toLog.add("add",adds); | |||
synchronized (toLog) { | |||
toLog.add("add",adds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processAdd(...)
reads with synchronization from this.adds
. Potentially races with unsynchronized write in method LogUpdateProcessorFactory$LogUpdateProcessor.processAdd(...)
.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
@@ -108,7 +108,9 @@ public void processAdd(AddUpdateCommand cmd) throws IOException { | |||
// Add a list of added id's to the response | |||
if (adds == null) { | |||
adds = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processAdd(...)
writes to field this.adds
outside of synchronization.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
@@ -131,7 +133,9 @@ public void processDelete( DeleteUpdateCommand cmd ) throws IOException { | |||
if (cmd.isDeleteById()) { | |||
if (deletes == null) { | |||
deletes = new ArrayList<>(); | |||
toLog.add("delete",deletes); | |||
synchronized (toLog) { | |||
toLog.add("delete",deletes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processDelete(...)
reads with synchronization from this.deletes
. Potentially races with unsynchronized write in method LogUpdateProcessorFactory$LogUpdateProcessor.processDelete(...)
.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
@@ -140,11 +144,13 @@ public void processDelete( DeleteUpdateCommand cmd ) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processDelete(...)
indirectly writes to field cmd.id
outside of synchronization.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
@@ -131,7 +133,9 @@ public void processDelete( DeleteUpdateCommand cmd ) throws IOException { | |||
if (cmd.isDeleteById()) { | |||
if (deletes == null) { | |||
deletes = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processDelete(...)
writes to field this.deletes
outside of synchronization.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
String msg = cmd.query; | ||
if (version != 0) msg = msg + " (" + version + ')'; | ||
toLog.add("deleteByQuery", msg); | ||
} | ||
} | ||
} | ||
numDeletes++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method LogUpdateProcessorFactory$LogUpdateProcessor.processDelete(...)
writes to field this.numDeletes
outside of synchronization.
Reporting because this access may occur on a background thread.
(at-me in a reply with help
or ignore
)
closing in favour of alternative changes e.g. #601 (or something else still) |
https://issues.apache.org/jira/browse/SOLR-15983