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

ZOOKEEPER-4514: ClientCnxnSocketNetty throwing NPE #1854

Closed

Conversation

arshadmohammad
Copy link
Contributor

Moved channel object null check to sendPkt method to cover all calling scenarios

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonatype-lift ignore

Copy link

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.

Copy link
Contributor Author

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

Copy link
Contributor

@symat symat left a 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).

@arshadmohammad
Copy link
Contributor Author

Thanks @symat for the review. I will merge it.

@asfgit asfgit closed this in d5876e8 Apr 8, 2022
asfgit pushed a commit that referenced this pull request Apr 8, 2022
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>
asfgit pushed a commit that referenced this pull request Apr 8, 2022
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>
asfgit pushed a commit that referenced this pull request Apr 8, 2022
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>
asfgit pushed a commit that referenced this pull request May 17, 2022
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)
anuragmadnawat1 pushed a commit to anuragmadnawat1/zookeeper that referenced this pull request Nov 1, 2022
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
anuragmadnawat1 added a commit to anuragmadnawat1/zookeeper that referenced this pull request Nov 1, 2022
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>
anurag-harness pushed a commit to anurag-harness/zookeeper that referenced this pull request Jan 13, 2023
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
anurag-harness added a commit to anurag-harness/zookeeper that referenced this pull request Jan 13, 2023
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>
desaikomal pushed a commit to linkedin/zookeeper that referenced this pull request Jun 17, 2023
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>
desaikomal pushed a commit to linkedin/zookeeper that referenced this pull request Jun 27, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants