Skip to content

[azservicebus] Adding a timeout so link closures have a maximum of 60 seconds before they are cancelled.#19886

Merged
richardpark-msft merged 28 commits intoAzure:mainfrom
richardpark-msft:sb-close-timeout
Feb 2, 2023
Merged

[azservicebus] Adding a timeout so link closures have a maximum of 60 seconds before they are cancelled.#19886
richardpark-msft merged 28 commits intoAzure:mainfrom
richardpark-msft:sb-close-timeout

Conversation

@richardpark-msft
Copy link
Copy Markdown
Member

@richardpark-msft richardpark-msft commented Jan 27, 2023

Adding a timeout so link closures have a maximum of 60 seconds before they time out. This fixes an issue that came up when I made a fix in the last release to not timeout on close (since that can leave us in an inconsistent state). This surfaced an interesting problem where customers do see Close() hang.

So this adds in a timeout instead, which will cause us to close the connection to avoid inconsistency and also to recover overall since it's likely there's a problem that will require a more thorough reset than a simple link detach/reattach would give us.

As part of this I also created some more thorough mocks that test more of the connection/open behavior as well as links, ensuring that we do cleanup and end up in the state that we want. It's not 100% complete but it's good enough for this kind of testing and can be expanded.

they time out. This fixes an issue that came up when I made a fix in the
last release to not timeout on close (since that can leave us in an
inconsistent state). This surfaced an interesting problem where
customers do see Close() hang.

So this adds in a timeout instead, which will cause us to close the
connection to avoid inconsistency and also to recover overall since it's
likely there's a problem that will require a more thorough reset than a
simple link detach/reattach would give us.

As part of this I also created some more thorough mocks that test more
of the connection/open behavior as well as links, ensuring that we do
cleanup and end up in the state that we want. It's not 100% complete but
it's good enough for this kind of testing and can be expanded.
@richardpark-msft
Copy link
Copy Markdown
Member Author

/azp run go - azservicebus

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft richardpark-msft marked this pull request as ready for review January 30, 2023 22:17
@richardpark-msft richardpark-msft self-assigned this Jan 30, 2023
@richardpark-msft richardpark-msft changed the title Adding a timeout so link closures have a maximum of 60 seconds before [azservicebus] Adding a timeout so link closures have a maximum of 60 seconds before Jan 30, 2023
@richardpark-msft
Copy link
Copy Markdown
Member Author

/azp run go - azservicebus

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread sdk/messaging/azservicebus/CHANGELOG.md
Comment thread sdk/messaging/azservicebus/go.mod Outdated
@richardpark-msft
Copy link
Copy Markdown
Member Author

/azp run go - azservicebus

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Member

@jhendrixMSFT jhendrixMSFT left a comment

Choose a reason for hiding this comment

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

I mainly focused on the changed in amqpLinks.go as that's where the behavior changes are.

@richardpark-msft richardpark-msft changed the title [azservicebus] Adding a timeout so link closures have a maximum of 60 seconds before [azservicebus] Adding a timeout so link closures have a maximum of 60 seconds before they are cancelled. Feb 2, 2023
@richardpark-msft richardpark-msft merged commit 1d833ec into Azure:main Feb 2, 2023
@richardpark-msft richardpark-msft deleted the sb-close-timeout branch February 2, 2023 22:29
@rokf
Copy link
Copy Markdown

rokf commented Feb 3, 2023

Now that these changes have reached the main branch, when can we expect them to land in a new https://github.com/Azure/azure-sdk-for-go version?

@richardpark-msft
Copy link
Copy Markdown
Member Author

Now that these changes have reached the main branch, when can we expect them to land in a new https://github.com/Azure/azure-sdk-for-go version?

Yes, it'll go out with the next regular release (next week).

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

Successfully merging this pull request may close these issues.

3 participants