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

[ServiceBus] Abandon not needed if AutoComplete is false #23423

Closed
wants to merge 2 commits into from

Conversation

zamzowd
Copy link
Contributor

@zamzowd zamzowd commented Aug 20, 2021

Resolving issues Azure/azure-functions-servicebus-extension#183 and Azure/azure-functions-servicebus-extension#142

If AutoComplete is false, then it should not attempt to abandon the message.

This change brings AbandonMessageIfNeededAsync in line with CompleteMessageIfNeededAsync.

I'm not sure if this counts as a breaking change. It's fixing an issue to bring it in line with the documentation, but that results in different behavior - throwing an exception will no longer cause the message to be abandoned if AutoComplete is false.

There were no existing unit tests for MessageReceivePump so I attempted to add some. Guidance welcome.

All SDK Contribution checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

  • Please open PR in Draft mode if it is:
    • Work in progress or not intended to be merged.
    • Encountering multiple pipeline failures and working on fixes.
  • [n/a] If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • I have read the contribution guidelines.
  • The pull request does not introduce breaking changes.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • [n/a] The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code. (Track 2 only)
  • [n/a] The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK. Please double check nuget.org current release version.

Additional management plane SDK specific contribution checklist:

Note: Only applies to Microsoft.Azure.Management.[RP] or Azure.ResourceManager.[RP]

  • [n/a] Include updated management metadata.
  • [n/a] Update AzureRP.props to add/remove version info to maintain up to date API versions.

Management plane SDK Troubleshooting

  • If this is very first SDK for a services and you are adding new service folders directly under /SDK, please add new service label and/or contact assigned reviewer.

  • If the check fails at the Verify Code Generation step, please ensure:

    • Do not modify any code in generated folders.
    • Do not selectively include/remove generated files in the PR.
    • Do use generate.ps1/cmd to generate this PR instead of calling autorest directly.
      Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version.

    Note: We have recently updated the PSH module called by generate.ps1 to emit additional data. This would help reduce/eliminate the Code Verification check error. Please run following command:

      `dotnet msbuild eng/mgmt.proj /t:Util /p:UtilityName=InstallPsModules`
    

Old outstanding PR cleanup

Please note:
If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.

@ghost ghost added Service Bus customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Aug 20, 2021
@ghost
Copy link

ghost commented Aug 20, 2021

Thank you for your contribution @zamzowd! We will review the pull request and get back to you soon.

@ghost ghost added the Community Contribution Community members are working on the issue label Aug 20, 2021
@zamzowd
Copy link
Contributor Author

zamzowd commented Aug 20, 2021

I'm not sure how I can "complete legal signoff" or get this code "fully code reviewed" as described in the Code Review Process

@jsquire
Copy link
Member

jsquire commented Aug 20, 2021

Hi @zamzowd. Thank you for your contribution and for helping to improve the Azure SDK experience. I've added some tags and routed to the team member best able to offer feedback.

@zamzowd
Copy link
Contributor Author

zamzowd commented Aug 20, 2021

Thanks for the assistance!

I noticed this morning that there's also SessionReceivePump and ReceiverManager that probably need to be updated in a similar manner.

Comparing the documentation, the wording for what AutoComplete does is different in Azure.Messaging.ServiceBus vs the Azure Functions Service Bus Trigger, even though their implementations are the same:

Ultimately, I'd like to be able to manually deadletter and then throw (for logging purposes). With AutoComplete off, I would expect what the ServiceBusTrigger documentation to describe: it also does not "AutoAbandon" when an exception is thrown.

Finally, and to reiterate, I'm not sure about my approach to unit testing this. I couldn't work out a way to unit test with any of the existing OnMessageQueueTests or uses of SenderReceiverClientTestBase.

@jsquire
Copy link
Member

jsquire commented Aug 20, 2021

@JoshLove-msft: Would you be so kind as to offer your thoughts on the Azure.Messaging.ServiceBus observations?

@Azure Azure deleted a comment from check-enforcer bot Aug 20, 2021
@JoshLove-msft
Copy link
Member

I'd suggest splitting out the Microsoft.Azure.ServiceBus changes into a separate PR from the Azure.Messaging.ServiceBus changes. I'm ready to approve the changes for Azure.Messaging.ServiceBus, but the changes for Microsoft.Azure.ServiceBus would need to be reviewed by the other reviewers on this PR.

@zamzowd
Copy link
Contributor Author

zamzowd commented Aug 25, 2021

@JoshLove-msft
I created a separate PR #23528 with just the documentation added to the Azure.Messaging.ServiceBus classes. After that's complete, and merged to main I'll try rebasing / resetting / squashing commits in this PR.

@zamzowd zamzowd force-pushed the zamzowd/abandon-autocomplete-only branch from eae8979 to ea3e8d0 Compare August 30, 2021 14:27
@zamzowd
Copy link
Contributor Author

zamzowd commented Aug 30, 2021

I rebased after the other PR was completed, as mentioned above. This PR no longer has anything in Azure.Messaging.ServiceBus, only in Microsoft.Azure.ServiceBus's MessageReceivePump and SessionReceivePump.

@zamzowd zamzowd marked this pull request as ready for review September 21, 2021 13:22
@zamzowd
Copy link
Contributor Author

zamzowd commented Sep 21, 2021

I'm not sure if there's anything further needed before exiting Draft on this PR, so I went ahead with Ready for Review.

As I understand it, primarily hoping for review from @DorothySun216 or @shankarsama as the code owners?

@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Nov 26, 2021
@ghost
Copy link

ghost commented Nov 26, 2021

Hi @zamzowd. Thank you, for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@ghost ghost closed this Dec 3, 2021
@ghost
Copy link

ghost commented Dec 3, 2021

Hi @zamzowd. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass.

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-net that referenced this pull request Apr 18, 2023
{AzurePostgresql} PostgreSQL flexibleServers doesn't support creation of 'SystemAssigned' resource identity (Azure#23423)

Fixes Azure/azure-rest-api-specs#23176

Per the [latest API](https://github.com/Azure/azure-rest-api-specs/edit/main/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/FlexibleServers.json), the flexibleServers should support creation of 'SystemAssigned' , but it doesn't . See the below for details:

Request:
PUT /subscriptions/?/resourceGroups/acctestRG-postgresql-230320155838217513/providers/Microsoft.DBforPostgreSQL/flexibleServers/acctest-fs-230320155838217513?api-version=2022-12-01

```
{"identity":{"type":"SystemAssigned"},"location":"eastus","properties":{"administratorLogin":"adminTerraform","administratorLoginPassword":"QAZwsx123","availabilityZone":"2","backup":{"geoRedundantBackup":"Disabled"},"highAvailability":{"mode":"Disabled"},"network":{},"storage":{"storageSizeGB":32},"version":"12"},"sku":{"name":"Standard_D2s_v3","tier":"GeneralPurpose"},"tags":{}}
```

Response:
```
{"error":{"code":"CannotSetResourceIdentity","message":"Resource type 'Microsoft.DBforPostgreSQL/flexibleServers' does not support creation of 'SystemAssigned' resource identity. The supported types are 'UserAssigned'."}}
```
This pull request was closed.
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. Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. no-recent-activity There has been no recent activity on this issue. Service Bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants