-
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] "Operator called default onErrorDropped" message caused by NullPointerException in freed connection #42429
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hello @haraldk, it looks like you're encountering the same issue described here: #41736 , but for the Processor. As outlined in there, could you try setting the configuration "com.azure.core.amqp.cache" to "true" for version 7.17.5, i.e., new ServiceBusClientBuilder()
.connectionString(queueProperties.connectionString())
.configuration(new ConfigurationBuilder()
.putProperty("com.azure.core.amqp.cache", "true")
.build())
.processor()
.queueName(queueProperties.name())
.disableAutoComplete()
.maxAutoLockRenewDuration(Duration.ofMinutes(10))
.processMessage(this::processMessage)
.processError(this::processError)
.buildProcessorClient() (In an upcoming release, the necessity to set this configuration will be removed.) |
@haraldk, just to let you know, if you're also using |
@anuchandy Thanks! I'll try that out, and see if it helps! It's not immediately clear to me (even after reading the linked issue) why setting this property to |
Hello @haraldk, the NPE was traced back to a bug in the internal caching system used by Service Bus and Event Hubs. We have incorporated (as part of September-2024 release) a new cache design which is enabled when the "com.azure.core.amqp.cache" configuration is set. This new internal cache is intended to offer the same functionality as the old one while resolving existing issues (including NPE, thread race conditions, and a rare thread leak), so there shouldn't be any side effect. We plan to delete the old cache in the upcoming releases and make new one default. More about this cache implementation is here if you're interested. |
We've been running with the |
Glad hear that this issue has been resolved. I will now close this. |
Describe the bug
Occasionally (several times a day) we get two errors in our application's log, first "{"az.sdk.message":"Retry attempts exhausted or exception was not retriable.","exception":"Cannot invoke "java.util.List.add(Object)" because "this._sessions" is null", ..." followed by one or more "Operator called default onErrorDropped" messages.
I don't think messages are actually lost (not processed) due to this, but the message is still very annoying, and as it happens often it creates noise in the logs. It does happen in all our environments.
I think this might be related to #41637 but I was surprised to see that upgrading to the latest servicebus release (7.17.5) did not remove the issue.
Exception or Stack Trace
We get two error messages in our log, only the second contains a stack trace. But I believe they are related:
To Reproduce
I don't have exact reproducer code at this time, as the code is quite complicated. We use a standard
ServiceBusProcessorClient
created from aServiceBusClientBuilder
like this:However, none of our code is actually involved in the stack trace above, so I don't think the contents of
processMessage
orprocessError
matters.From what I can see, the only way the
_sessions
field inorg.apache.qpid.proton.engine.impl.ConnectionImpl
can benull
, is someone first invokingdoFree()
. Ie. it seems that someone/something tries to create a new session from an already freed connection. This might be due to a race condition, or a simpler logic bug somewhere.Let me know if you need more information to reproduce.
Code Snippet
No code at the moment.
Expected behavior
I would expect the connection to be freed and a new session created in a new, fresh session, without any exceptions or error messages in the log.
Setup (please complete the following information):
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: