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

[QUERY] ServiceBusProcessorClient lock expiry #41981

Open
2 tasks done
rileymichael opened this issue Sep 23, 2024 · 4 comments
Open
2 tasks done

[QUERY] ServiceBusProcessorClient lock expiry #41981

rileymichael opened this issue Sep 23, 2024 · 4 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. 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

Comments

@rileymichael
Copy link

rileymichael commented Sep 23, 2024

Query/Question
Hello! I'm wanting to create a lock expiry monitor for the ServiceBusProcessorClient in PEEK_LOCK mode. I've done a bit of research and was hoping you could point me in the right direction:

  • On failed lock refresh (due to network failure for example, within maxAutoLockRenewDuration) and when maxAutoLockRenewDuration has been exhausted, processError is not invoked. This makes sense as processMessage is still running / possibly can't be interrupted. Is there another way to hook into these events?
  • Within our processMessage handler, we could check message.message.lockedUntil, which is updated on lock refresh. This only works for non-session processors however, when using sessions messages are locked until +10000-01-01T00:00:00Z (which I'm assuming is because the lock is held for the entire session, even past sessionIdleTimeout). Is there a way of retrieving the actual lockedUntil value?

Why is this not a Bug or a feature Request?
I'm curious about functionality which may already exist.

Setup (please complete the following information if applicable):

  • Library/Libraries: com.azure:azure-messaging-servicebus:7.17.2

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

  • Query Added
  • Setup information Added
@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 23, 2024
Copy link

@anuchandy @conniey @lmolkova

Copy link

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

@anuchandy
Copy link
Member

anuchandy commented Sep 24, 2024

Hello @rileymichael, you are correct that for session scenarios, each message does not include the lock timeout, as the lock is scoped to the session.

I'm not exactly sure what the monitoring you mentioned targets, but if it helps, the library emits telemetry for observability purposes - for sessions, there is session lock renew spans and spans for message operations like receiving, completing, or abandoning messages.

@rileymichael
Copy link
Author

Thanks for the reply @anuchandy. To be more clear, we want to run some logic in the event a message lock expires before handling has completed (the monitor was just a simple usecase example). We've looked at comparing the current time with the lock expiration time, but as you've confirmed that's not always held by the message. Is it possible to get the session expiration?

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. 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
Projects
None yet
Development

No branches or pull requests

2 participants