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

Unable to detect link detach (session lock lost) in message settlement in service bus #183

Open
yunhaoling opened this issue Nov 18, 2020 · 1 comment

Comments

@yunhaoling
Copy link
Contributor

yunhaoling commented Nov 18, 2020

In service bus, when a sessionful entity's lock expired, the service would send a detach frame indicating the session lock is lost.
However, in uamqp settlement calling, we don't receive and handle amqp frames which means we're unable to detect whether these is a session lock lost, and we send the disposition frame out which would fail silently.

On the other side, even if we do connection.work before sending out the disposition frame and try to get the link detach frame. There is an edge case that when we drain the messages on the session queue, we still cannot receive the detach frame. In this case, the error condition might come up with the disposition outcome which is another feature we're missing, see issue:
Azure/azure-uamqp-c#274

It seems like there're two pattern in the service to bubble session lock lost error to the client:

  1. send a detach
  2. via message settlement disposition result

To tackle the issue, we would first need to add the missing disposition outcome feature.

@yunhaoling yunhaoling changed the title Unable to detect link detach (session lock lost) in message settlement Unable to detect link detach (session lock lost) in message settlement in service bus Nov 18, 2020
@yunhaoling
Copy link
Contributor Author

rhea-amqp would get the following error:

Error occurred:  ServiceBusError: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue. Reference:4343a239-f84c-4c55-9147-8aad89c0f914, TrackingId:742092890000000300000f865fb47b97_G1_B2, SystemTracker:harshan-canary-2:Queue:non-session-445, Timestamp:2020-11-18T01:40:59
    at translateServiceBusError (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\@azure\service-bus\src\serviceBusError.ts:164:12)
    at onMessageSettled (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\@azure\service-bus\src\core\shared.ts:63:23)
    at Receiver.onSettled (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\@azure\service-bus\src\core\messageReceiver.ts:188:16)
    at Receiver.emit (events.js:321:20)
    at Receiver.EventEmitter.emit (domain.js:482:12)
    at emit (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\rhea-promise\lib\util\utils.ts:185:20)
    at Object.emitEvent (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\rhea-promise\lib\util\utils.ts:197:5)
    at Receiver.<anonymous> (C:\Users\sanallur\Desktop\Work\sb-track-2-samples\node_modules\rhea-promise\lib\link.ts:328:11)
    at Receiver.emit (events.js:321:20)
    at Receiver.EventEmitter.emit (domain.js:482:12) {
  name: 'ServiceBusError',
  retryable: false,
  info: null,
  code: 'MessageLockLostError',
  reason: 'MessageLockLost'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant