-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Creating sender connection is taking 8-10 seconds after the connection is closed after idle connection timeout. #35266
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @EldertGrootenboer. |
Thank you for the feedback @fhzhang. We will investigate and get back to you asap. |
@fhzhang Looking at the repro, there are a few changes that need to be made to determine the amount of time it takes to connect to ServiceBus Taking a look at the snippet below, no connection activity happens until the first action is executed, which in this case is So the proper way to update the snippet above would be to calculate the start time after send messages, as it will first check if the connection is open, then open it and then send the message. After a connection detach, there is some clean up that needs to happen and that can take some time too. If you set the log level to DEBUG youll see when the connection activity starts asb_client = ServiceBusClient.from_connection_string(
conn_str=CONN_STR,
transport_type=TransportType.AmqpOverWebsocket
)
asb_sender = asb_client.get_queue_sender(queue_name=QUEUE_NAME)
msg = ServiceBusMessage("test")
asb_sender.send_messages(msg) |
Hi @fhzhang. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
I have two questions here.
|
@fhzhang Im taking a look at # 1 and see if there is something going on that is causing it wait 9 to 10 seconds. for question 2, there is no other way to keep the connection open. The timeout is set by the service itself and the easiest way to show activity over the connection is to do exactly as you described. |
Hey @kashifkhan - we're seeing something similar as well
After a 10 minute wait from the previous message send - we notice that our traces jump to 7-8 seconds to get a message sent through. what would the solution be for this? we'd like to maintain a good latency with sending messages to queues |
Hi @fhzhang this latency has been addressed and a fix will be out in our next release. |
Hi @fhzhang. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
Hi @fhzhang, since you haven’t asked that we |
Describe the bug
For the first time when we create the sender object, it is ONLY taking 1-2 seconds, but after sleeping for 660 seconds, the connection is closed automatically and try to create sender object again with following code.
logger.info("getting queue sender")
asb_sender = asb_client.get_queue_sender(queue_name=QUEUE_NAME)
It will take 8-10 seconds to create the sender.
My question is how come it will take ONLY 1-2 seconds for the first time, but it takes more than 8 seconds after the connection is closed after the idle connection timeout.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Since it is taking 1-2 seconds for the first time sender connection, it should take 1-2 seconds after the idle connection timeout.
Screenshots
2024-04-18 18:07:11,270 | INFO | ServiceBus | Connecting to sb...
2024-04-18 18:07:11,271 | INFO | ServiceBus | Service Bus connected
2024-04-18 18:07:11,271 | INFO | ServiceBus | Creating sender...
2024-04-18 18:07:11,377 | INFO | ServiceBus | Sender created
2024-04-18 18:07:11,377 | INFO | ServiceBus | Sending message
2024-04-18 18:07:14,875 | INFO | ServiceBus | Message sent
2024-04-18 18:18:14,878 | INFO | ServiceBus | Sending message
2024-04-18 18:18:25,748 | INFO | ServiceBus | Message sent
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: