-
Notifications
You must be signed in to change notification settings - Fork 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
[BUG] NullPointerException in Apache Qpid Proton-J during Azure Service Bus AMQP Reconnection #41865
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hello @pretti-vusion, thank you for reporting. We looked into a similar stack trace here. The code changes with fix are checked-in. The Service bus and Event Hubs with these changes should be released in 1-2 weeks. |
Hi @anuchandy , thanks for the info, i'm looking forward to it. |
@anuchandy Would it be possible to tag this ticket when the release is made. We are seeing the exact same thing. |
@amacbean, sure, I will update here with link to the released version and any instructions. |
@anuchandy, has there been a ticket for the Apache Qpid project filed as well? I think, even though your upcoming changes will solve the issue for us, it might be a good idea for them to add a null-check at this point to prevent any unnecessary NPE. |
Hi @pretti-vusion, thanks for the message. We don't have to open a ticket for Qpid, let me explain. The Qpid library assume that it's APIs are always accessed by "one and the same" thread (Reactor-Thread) throughput the lifetime of the Connection. This is the reason we don't see any locks or concurrent safety guards in Qpid. So reg: your comment on check in Qpid – Yes, it would be nice if Qpid provided a check and clearer error message. However, Qpid assume it's APIs will be called by a single thread and serially. So, if that thread disposes of the connection, then code that serially follows the disposal should be aware it can't make further API calls. Part of SB/EH libraries is a multi-threading layer on the top of Qpid, so users can scale the message/event processing and perform blocking or external service calls. The reason for the NPE was, as part of recovering from a network disconnect, the type AmqpChannelProcessor (in SB/EH libraries) were attempting to access a Qpid API from "retry thread" that runs concurrently with the Reactor-Thread. We believe the new cache design replacing AmqpChannelProcessor (the pr linked in the earlier comment) will address this issue. It’s unfortunate that we (library owners) are unable to reproduce this NPE while few customers, including you were running into this randomly. Although theoretically, the new cache design addresses this code path, we still need affected customers to confirm its effectiveness. We're also running our stress tests on to-be-released bits to confirm things are good. Hope this helps. |
@anuchandy, thanks you very much for the detailed explanation. All clear now. |
Hello @pretti-vusion, @amacbean, the updated library is released. Please follow the instructions outlined here #41736 (comment) and let us know here how it goes. thanks! |
This issue is resolved as the fix has been released in version 7.14.4. |
Hi @anuchandy what is impact of above issue on service bus message publishing functionality (as we observed message is still getting published). |
Hello @tornadoJK, a user noticed a thread leak linked to a NullPointerException in a specific environment. So, we recommend upgrading as outlined here. It's worth noting that the same user did not notice a leak in their other env. Additionally, the rest of the users (see the linked SB/EH issues) who have experienced NPE didn't encounter leaks, so it was less severe for them, and the Sender continues to function properly. Even if you don't see leaks, preparing for the upgrade is advisable. |
Describe the bug
We are encountering a
NullPointerException
in theorg.apache.qpid.proton
library, triggered during session creation while using theazure-messaging-servicebus
dependency to connect to Azure Service Bus. This exception happens intermittently, particularly after the connection has been idle for around 30 seconds, suggesting it may be related to reconnect behavior. Despite the exception, normal operations seem unaffected.Exception or Stack Trace
To Reproduce
Steps to reproduce the behavior:
Set up an application using Azure Service Bus via AMQP with the following dependency:
com.azure:azure-messaging-servicebus:7.17.0
After the connection to the Azure Service Bus is idle for around 30 seconds, the system reconnects.
A
NullPointerException
is intermittently thrown during session re-creation.Code Snippet
// Sample code illustrating initialization of Servicebus client
Expected behavior
The reconnection process should not result in a
NullPointerException
. The internal sessions should be properly initialized during reconnections, without throwing errors.Screenshots
Not applicable
Setup (please complete the following information):
OS: Linux
IDE: IntelliJ IDEA
Library:
com.azure:azure-messaging-servicebus:7.17.0
Java version: 21
App Server/Environment: Azure Service Bus (AMQP)
Frameworks: Spring Boot 3.2.5
Additional context
The issue appears to be related to reconnections to the Azure Service Bus after a 30-second idle period. The NullPointerException originates from the org.apache.qpid.proton.engine.impl.ConnectionImpl class, which is used internally by the Azure SDK, specifically during session creation. This may indicate an issue in how the Azure SDK interacts with the Apache Qpid Proton-J library.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: