Skip to content
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

Azure service bus send heartbeat to keep connection alive #37298

Open
ShirishGajera opened this issue Sep 11, 2024 · 6 comments
Open

Azure service bus send heartbeat to keep connection alive #37298

ShirishGajera opened this issue Sep 11, 2024 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Messaging Messaging crew needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@ShirishGajera
Copy link

ShirishGajera commented Sep 11, 2024

Is your feature request related to a problem? Please describe.
If I understand correctly if there are no activity for 4 minutes on Azure service bus connection client, connection will die and that what I am hitting. I am trying to complete the message and seeing this exception.


Unexpected error occurred (ValueError('Link already closed.')). Handler shutting down.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/azure/servicebus/aio/_base_handler_async.py", line 260, in _do_retryable_operation
    return await operation(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/azure/servicebus/aio/_servicebus_receiver_async.py", line 522, in _settle_message
    await self._amqp_transport.settle_message_via_receiver_link_async(
  File "/usr/local/lib/python3.10/dist-packages/azure/servicebus/aio/_transport/_pyamqp_transport_async.py", line 320, in settle_message_via_receiver_link_async
    return await handler.settle_messages_async(message._delivery_id, 'accepted')
  File "/usr/local/lib/python3.10/dist-packages/azure/servicebus/_pyamqp/aio/_client_async.py", line 1004, in settle_messages_async
    await self._link.send_disposition(
  File "/usr/local/lib/python3.10/dist-packages/azure/servicebus/_pyamqp/aio/_receiver_async.py", line 129, in send_disposition
    raise ValueError("Link already closed.")
ValueError: Link already closed.

Describe the solution you'd like
I want to set heartbeat to keep the connection live when creating client using from_connection_string()

Describe alternatives you've considered
I am currently recreating client every 3 minutes as work around

If there is already existing solution please let me know

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus labels Sep 11, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@kristapratico
Copy link
Member

@ShirishGajera thanks for your question, the team will take a look and respond as soon as possible.

@l0lawrence
Copy link
Member

@ShirishGajera can you share the code sample giving you this error to help us better understand your scenario?

@kashifkhan kashifkhan added Messaging Messaging crew needs-author-feedback Workflow: More information is needed from author to address the issue. labels Sep 11, 2024
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Sep 11, 2024
Copy link

Hi @ShirishGajera. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@arpan-reconectai
Copy link

Even I am facing the same challenge. The python sdk doesn't have proper connection management / pooling feature for service bus. So I built my own asyncio based connection pooling based of a FIFO asyncio.Queue. However, the connection drops due to inactivity for some time, and for n requests, it takes 10 seconds each to refresh the connections, where n is the pool size.

Copy link

Hi @ShirishGajera, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Messaging Messaging crew needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

6 participants