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

Breaking Change: futures are no longer populating their Result() causing panic on access #14540

Closed
jackofallops opened this issue Apr 15, 2021 · 1 comment · Fixed by #14547
Closed
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. CodeGen Issues that relate to code generation customer-reported Issues that are reported by GitHub users external to the Azure organization.

Comments

@jackofallops
Copy link

Bug Report

This is a general approach to the generated SDK, so affects many APIs and versions, if not all that use futures/LROs. The autorest result is no longer being assigned to the future.Response() which means on error, this causes a panic if checked for the response code:

e.g.

	future, err := client.Delete(ctx, id.ResourceGroup, id.HostingEnvironmentName, forceDeleteAllChildren)
	if err != nil {
		if response.WasNotFound(future.Response()) {
			return nil
		}
	}
  • What happened?
    When an LRO errors, this value is checked to be able to surface the result / status to the user. Since this is no longer populated, we get a nil panic:
    panic: runtime error: invalid memory address or nil pointer dereference

A PR that may fix this is here: Azure/autorest.go#605

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 15, 2021
@ArcturusZhang ArcturusZhang added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 16, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Apr 16, 2021
@ArcturusZhang ArcturusZhang added the CodeGen Issues that relate to code generation label Apr 16, 2021
@ArcturusZhang
Copy link
Member

Hi @jackofallops thanks for opening this.

The fix in autorest.go for this issue has been merged. And we are planning to release an extra minor version today to refresh every package in the sdk to resolve this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. CodeGen Issues that relate to code generation customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants