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

[service-bus] Check abortSignal in SessionReceiver.subscribe() #11281

Merged

Conversation

richardpark-msft
Copy link
Member

Check the abort signal in sessionReceiver.subscribe().

Fixes #4375
(finally)

…er options.

As part of this I can remove it from the SubscribeOptions and SessionSubscribeOptions since they already inherit from MessageHandlerOptionsBase.
…() will respect an abort signal like Receiver.subscribe() does.

Adding in tests for receiver and sessionreceiver.
@richardpark-msft
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).


if (options.abortSignal?.aborted) {
throw new AbortError(StandardAbortMessage);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the only net change... and is very deceptively simple...

I see how the abort signal is passed to the link creation time and the one with the receiveMessages().
This change ensures that an already aborted signal will result in cancelling the subscribe() method.

How are we ensuring that once subscribe() is called and then abort signal is fired that we cancel the operation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check - is this the scenario you're talking about with regards to cancellation?

https://github.com/Azure/azure-sdk-for-js/pull/11281/files#diff-220199656e7c07d2ec0c2ab9378ccb28R321

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, @richardpark-msft will be logging an issue for the concern I raised above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(for summary)

The abortSignal passed into subscribe, currently, only applies logically to the initialization of the subscription itself. If the subscription starts (ie, handlers are registered for receiving messages, credits on the line) the abortSignal no longer applies.

The way we have it, as is, has tripped up a few people in discussions so we want to revisit this: #11296

@richardpark-msft richardpark-msft merged commit 294c7d9 into Azure:master Sep 16, 2020
@richardpark-msft richardpark-msft deleted the richardpark-sb-track2-abort branch September 16, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Service Bus] Support cancellation of user facing operations
2 participants