-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_windows_web_app
, azurerm_windows_web_app_slot
, azurerm_linux_web_app
, azurerm_linux _web_app_slot
- fix auto heal slow request with path issue
#20049
Conversation
I can confirm that the linked issue 17862 is not fixed yet, even though the previous PR was closed because it was supposedly superseded by another one. Tried today in Azure provider 3.39.1, the autoheal settings (sub_status and win32_status) are not set, and behaviour is still the same as described in the original issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xiaxyi - Thanks for this and apologies again for the delayed review.
I think we have a design issue here. The two properties are present in the swagger, and as far as I can tell, both should be maintained / supported? Which means we should be able to simply add this as a new property? possibly as ConflictsWith
on slow_requests
if appropriate to only have one? WDYT?
Thanks @jackofallops for the suggestion, I didn't remove the |
Looking forward to this merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xiaxyi - Thanks for this. I've left some comments below if you can take a look?
Thanks!
internal/services/appservice/windows_web_app_slot_resource_test.go
Outdated
Show resolved
Hide resolved
count = "10" | ||
interval = "00:10:00" | ||
time_taken = "00:00:10" | ||
path = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an Optional
field, so should be omitted. It will also cause the test to fail when the 4.0 flag is set to true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Thanks @jackofallops for the review, I updated the code, added the validation and deprecation message. Regarding the documentation, shall we still remove the |
Hi @xiaxyi - Apologies for the delay in re-review. I have found there's a crash behind the feature flag here, which I don't believe can be addressed in this PR as the schema and the underlying go structs will no longer be compatible when the feature flag is set to true, so I'm going to mark this as |
@jackofallops I don't see any crash when running the tests, what about from your side? I see Tom removed the Block tag, would you like to share some updates with me? Thanks! |
Now that the API has been updated and resources migrated can you please resolve the conflicts here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xiaxyi - Thanks for this PR, and sorry it fell between the cracks for so long. There's some changes to take a look at below, but if you can get those sorted, I think this will be good to go.
Thanks!
type AutoHealSlowRequestWithPath struct { | ||
TimeTaken string `tfschema:"time_taken"` | ||
Interval string `tfschema:"interval"` | ||
Count int `tfschema:"count"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count int `tfschema:"count"` | |
Count int64 `tfschema:"count"` |
@@ -47,6 +49,13 @@ type AutoHealSlowRequest struct { | |||
Path string `tfschema:"path"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be able to remove this from the schema below, the struct needs to be tagged as below or we'll get a error in decoding.
Path string `tfschema:"path"` | |
Path string `tfschema:"path,removedInNextMajorVersion"` |
trigger := webapps.SlowRequestsBasedTrigger{ | ||
TimeTaken: pointer.To(sr.TimeTaken), | ||
TimeInterval: pointer.To(sr.Interval), | ||
Count: pointer.To(int64(sr.Count)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count: pointer.To(int64(sr.Count)), | |
Count: pointer.To(sr.Count), |
sr := AutoHealSlowRequestWithPath{ | ||
TimeTaken: pointer.From(v.TimeTaken), | ||
Interval: pointer.From(v.TimeInterval), | ||
Count: int(pointer.From(v.Count)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count: int(pointer.From(v.Count)), | |
Count: pointer.From(v.Count), |
trigger := webapps.SlowRequestsBasedTrigger{ | ||
TimeTaken: pointer.To(sr.TimeTaken), | ||
TimeInterval: pointer.To(sr.Interval), | ||
Count: pointer.To(int64(sr.Count)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count: pointer.To(int64(sr.Count)), | |
Count: pointer.To(sr.Count), |
@@ -790,7 +804,9 @@ A `trigger` block supports the following: | |||
|
|||
* `requests` - (Optional) A `requests` block as defined above. | |||
|
|||
* `slow_request` - (Optional) One or more `slow_request` blocks as defined above. | |||
* `slow_request` - (Optional) A `slow_request` blocks as defined above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `slow_request` - (Optional) A `slow_request` blocks as defined above. | |
* `slow_request` - (Optional) A `slow_request` block as defined above. |
@@ -773,6 +773,20 @@ A `slow_request` block supports the following: | |||
|
|||
* `path` - (Optional) The path for which this slow request rule applies. | |||
|
|||
~> **NOTE:** `path` in `slow_request` block will be deprecated in 4.0 provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~> **NOTE:** `path` in `slow_request` block will be deprecated in 4.0 provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. | |
~> **NOTE:** The `path` property in the `slow_request` block is deprecated and will be removed in 4.0 of provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. |
@@ -821,7 +835,9 @@ A `trigger` block supports the following: | |||
|
|||
* `requests` - (Optional) A `requests` block as defined above. | |||
|
|||
* `slow_request` - (Optional) One or more `slow_request` blocks as defined above. | |||
* `slow_request` - (Optional) A `slow_request` blocks as defined above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `slow_request` - (Optional) A `slow_request` blocks as defined above. | |
* `slow_request` - (Optional) A `slow_request` block as defined above. |
@@ -770,6 +770,20 @@ A `slow_request` block supports the following: | |||
|
|||
* `path` - (Optional) The path for which this slow request rule applies. | |||
|
|||
~> **NOTE:** `path` in `slow_request` block will be deprecated in 4.0 provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~> **NOTE:** `path` in `slow_request` block will be deprecated in 4.0 provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. | |
~> **NOTE:** The `path` property in the `slow_request` block is deprecated and will be removed in 4.0 of provider. Please use `slow_request_with_path` to set a slow request trigger with path specified. |
@@ -810,7 +824,9 @@ A `trigger` block supports the following: | |||
|
|||
* `requests` - (Optional) A `requests` block as defined above. | |||
|
|||
* `slow_request` - (Optional) One or more `slow_request` blocks as defined above. | |||
* `slow_request` - (Optional) A `slow_request` blocks as defined above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `slow_request` - (Optional) A `slow_request` blocks as defined above. | |
* `slow_request` - (Optional) A `slow_request` block as defined above. |
@jackofallops Thanks for the review, I updated the code as comments. Let me know if you have any other feedbacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xiaxyi - Apologies for the very long tail on this one. LGTM now 👍
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
In current provider, we only allow user to set the slow request rule with one path, but slow request rule with multiple paths is also supported by api, checking the property - slowRequestsWithPath:
The previous PR #18227 was closed but the issue was not fixed.
fix #19256
fix #22492
Local Acc test: