-
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] ServiceBusSessionReceiverClient.acceptNextSession returns null #28337
Comments
Hi @lidkowiak thank you for filing this GitHub issue on ServiceBusSessionReceiverClient.acceptNextSession. Someone from the Service Bus SDK for Java development team will follow up with you shortly. /cc @ki1729 @Azure/azsdk-sb-java |
@lidkowiak Can you please help clear up a couple of things for me?
|
@ki1729 The null is returned by the call to this method: Line 83 in 11da1c2
We expect that the SessionBusSessionReceiverClient.acceptNextSession either returns us initialized instance of ServiceBusReceiver client or throws exception that we handle. For rare cases this method returns us null, which is undocumented and we believe is a bug. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Dear @msftbot, we are waiting for the author's feedback. |
@piotr-napadlek Thanks for the clarification. As you have mentioned, acceptNextSession() method should never return null here. We have stress tests running which seems to be creating this client without any issues. Can you please provide some sample code, incuding the configuration used for the session receiver - so that I can try to repro this on my end. |
@ki1729 Here is the whole class: https://gist.github.com/lidkowiak/aad9a98e37cb3bb611bf6eb8caf5bd65 |
Thanks @lidkowiak! This helps. I have had tests running this code (removed - messageHandler) for >24 hours now. acceptNextSession() hasn't returned null yet. I will leave it running over the weekend just to be sure. Just to get as close a test environment as possible, can you please share the following details about the servicebus namespace that you use (I have indicated the value I am using in my test run at the end):
|
Hi,
Are you able to verify whether it could be caused by maintenance on Service Bus? |
Hi, not sure if you are still monitoring but the problem does not occur daily. We have spike in exceptions caused by this null pointer at random times, around once a week. We've observed it again this weekend 5/22/2022, 1:01:59.000 PM UTC. It's usually connected to another kind of exceptions thrown by the library:
|
Any progress/information about this one? Last night we've had alerts firing because of thousands of exceptions caused by this issue. |
@piotr-napadlek @lidkowiak we're going to mitigate this issue with #35139. Sorry, it's been a while since you reported it, but if you still see the issue, could you please share logs (info or verbose) with us so we can see if we can improve the solution further? Thank you! |
Hi @lidkowiak, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
Describe the bug
ServiceBusSessionReceiverClient acceptNextSession returns sometimes null instead of throwing IllegalStateException exception
Exception or Stack Trace
The exception log and stack trace from our code (not directly from SDK)
java.lang.NullPointerException: Cannot invoke "com.azure.messaging.servicebus.ServiceBusReceiverClient.receiveMessages(int, java.time.Duration)" because "serviceBusReceiverClient" is null at <OUR_PACKAGE>.servicebus.processor.SessionsHandler.processSession(SessionsHandler.java:100) at <OUR_PACKAGE>.servicebus.processor.SessionsHandler.processSessions(SessionsHandler.java:73) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:833)
Around same time we got following logs:
{"az.sdk.message":"","exception":"Cannot create receive link from a closed session., errorContext[NAMESPACE: <OUR SB NS>.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: <OUR TOPIC>/subscriptions/<OUR-SUBSCRIPTION>]","connectionId":"MF_387eb6_1649755334607","sessionName":"<OUR TOPIC>/subscriptions/<OUR-SUBSCRIPTION>","entityPath":"<OUR TOPIC>/subscriptions/<OUR-SUBSCRIPTION>","linkName":"session-_349db7_1649889915864"}
To Reproduce
Unknown
Code Snippet
processSession(serviceBusSessionReceiverClient.acceptNextSession());
Expected behavior
Exception should be thrown.
Screenshots
Not related
Setup (please complete the following information):
Additional context
Not related
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: