-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Event Hubs] Client throws error when closing due to failure in closing the management link #9615
Comments
Logged amqp/rhea-promise#54 for follow up in rhea-promise |
Early update: Still investigating, but did find something else that's interesting. When I run the sample code above and comment out the 1st |
I haven't dug too deep into why the above error is happening, but I did notice something odd with the azure-sdk-for-js/sdk/core/core-amqp/src/requestResponseLink.ts Lines 237 to 241 in e51a1d4
Note that we call close on the sender and receiver before closing the session.
Now, I'm not yet sure why this causes an error in sender.close since the session should be closed only after the sender is done closing. I would have expected sender.close() to work and possibly receiver.close() to fail instead. I'll need to investigate a little more why the error is being thrown in sender.close so I can be more sure if this change actually fixes the underlying issue or just improves it. |
This was done in amqp/rhea-promise#44 |
Run the below code a few times.
Most of the time it would succeed, but once in a while you will see the below error from
client.close()
This does not happen if you remove the code for
client.getPartitionIds()
or change the maxWaitTimeInSeconds to a value greater than 0On digging deeper, I found the below:
undefined
. This is coming from theerror
event that gets fired when we attempt to close the link. See https://github.com/amqp/rhea-promise/blob/b792d847ba5bb1adf7872aa49a6e1b779e46f754/lib/link.ts#L266-L271context.session.error
isundefined
and therefore we see the same getting bubbled upOn console logging all other places in the context that could have the right error, I found that
context.sender.error
indeed has the error which isThis error seem to be coming from the service and is not something that the client or any of its dependencies throw. I might be wrong.
I don't see this when changing the
maxWaitTimeInSeconds
to a value greater than 0, so it tells me that this must be some kind of race condition, but I fail to see how this can affect the management linkThe text was updated successfully, but these errors were encountered: