-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
ZOOKEEPER-4514: ClientCnxnSocketNetty throwing NPE #1854
Conversation
Moved channel object null check to sendPkt method to cover all calling scenarios
@@ -374,9 +377,6 @@ private void doWrite(Queue<Packet> pendingQueue, Packet p, ClientCnxn cnxn) { | |||
|
|||
@Override | |||
void sendPacket(ClientCnxn.Packet p) throws IOException { | |||
if (channel == null) { | |||
throw new IOException("channel has been closed"); | |||
} | |||
sendPktAndFlush(p); |
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 ClientCnxnSocketNetty.sendPacket(...)
indirectly reads without synchronization from this.channel
. Potentially races with write in method ClientCnxnSocketNetty.cleanup()
.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
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.
@sonatype-lift ignore
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.
I've recorded this as ignored for this pull request. If you change your mind, just comment @sonatype-lift unignore
.
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.
There is no new code added which is related to THREAD_SAFETY_VIOLATION
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.
LGTM, thanks!
We should push this back to all active branches (if it is an easy cherry-pick).
Thanks @symat for the review. I will merge it. |
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes #1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes #1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes #1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes #1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org> (cherry picked from commit cb79fb9)
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe Co-authored-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe Co-authored-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios Author: Mohammad Arshad <arshad@apache.org> Reviewers: Mate Szalay-Beko <symat@apache.org> Closes apache#1854 from arshadmohammad/ZOOKEEPER-4514-npe (cherry picked from commit d5876e8) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Moved channel object null check to sendPkt method to cover all calling scenarios