Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

cpoerschke
Copy link
Contributor

@cpoerschke cpoerschke marked this pull request as ready for review February 4, 2022 18:02
@@ -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);
Copy link

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<>();
Copy link

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);
Copy link

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 {
Copy link

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<>();
Copy link

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++;
Copy link

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)

@cpoerschke cpoerschke changed the title SOLR-15983: synchronise LogUpdateProcessor's toLog member use SOLR-15983: synchronise LogUpdateProcessor's members use Feb 7, 2022
@cpoerschke
Copy link
Contributor Author

closing in favour of alternative changes e.g. #601 (or something else still)

@cpoerschke cpoerschke closed this Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant