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

NPE in at org.asynchttpclient.netty.channel.Channels.setAttribute(Channels.java:36) #2042

Open
xiaoawo opened this issue Dec 4, 2024 · 3 comments

Comments

@xiaoawo
Copy link

xiaoawo commented Dec 4, 2024

java.lang.NullPointerException
at org.asynchttpclient.netty.channel.Channels.setAttribute(Channels.java:36)
at org.asynchttpclient.netty.channel.Channels.setDiscard(Channels.java:40)
at org.asynchttpclient.netty.NettyResponseFuture.cancel(NettyResponseFuture.java:183)

@xiaoawo
Copy link
Author

xiaoawo commented Dec 4, 2024

I noticed that in the done() and abort() methods, the channel is set to null. If the code at line 182 (channel != null) is executed at this time, and another thread executes done() or abort(), it may lead to a NullPointerException at org.asynchttpclient.netty.channel.Channels.setAttribute(Channels.java:36).

@hyperxpro
Copy link
Member

This is likely a race condition. Do you plan for a PR?

@xiaoawo
Copy link
Author

xiaoawo commented Dec 6, 2024

This is likely a race condition. Do you plan for a PR?

yes,I will handle it in the next two days and provide a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants