-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add default conditions to PA to avoid potential race conditions (2nd attempt) #16078
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,7 +184,8 @@ func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *autoscalingv1alpha1.PodA | |
| rs.DesiredReplicas = ps.DesiredScale | ||
| } | ||
|
|
||
| if cond == nil { | ||
| sksCondition := ps.GetCondition(autoscalingv1alpha1.PodAutoscalerConditionSKSReady) | ||
| if cond == nil || (cond.IsUnknown() && sksCondition != nil && sksCondition.IsUnknown()) { | ||
| rs.MarkActiveUnknown(ReasonDeploying, "") | ||
|
|
||
| if !resUnavailable { | ||
|
|
@@ -219,6 +220,7 @@ func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *autoscalingv1alpha1.PodA | |
| // 2. Initial scale was never achieved, which means we failed to progress | ||
| // towards initial scale during the progress deadline period and scaled to 0 | ||
| // failing to activate. | ||
| // 3. Need to make sure to wait for SKS to be ready, or at least fail. | ||
| // So mark the revision as failed at that point. | ||
| // See #8922 for details. When we try to scale to 0, we force the Deployment's | ||
| // Progress status to become `true`, since successful scale down means | ||
|
|
@@ -228,7 +230,7 @@ func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *autoscalingv1alpha1.PodA | |
| // ScaleTargetInitialized down the road, we would have marked resources | ||
| // unavailable here, and have no way of recovering later. | ||
| // If the ResourcesAvailable is already false, don't override the message. | ||
| if !ps.IsScaleTargetInitialized() && !resUnavailable && ps.ServiceName != "" { | ||
| if !ps.IsScaleTargetInitialized() && !resUnavailable && ps.ServiceName != "" && !sksCondition.IsUnknown() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you comment on why we want to add an additional check here? Probably worth updating the comment as well
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as other comment, I believe that there were cases now that the pa has conditions at the start, it was not waiting for the service to get ready, so I was trying to make sure to simulate the previous cases before defaulting pa conditions |
||
| rs.MarkResourcesAvailableFalse(ReasonProgressDeadlineExceeded, | ||
| "Initial scale was never achieved") | ||
| } | ||
|
|
||
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.
Can you explain why we need the extra clauses?
I would think we could simply have
cond == nil || cond.IsUnknown()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.
I believe that there were cases now that the pa has conditions at the start, it was not waiting for the service to get ready, so I was trying to make sure to simulate the previous cases before defaulting pa conditions