-
Notifications
You must be signed in to change notification settings - Fork 72
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
Improve the logic of grace period #226
Conversation
19c1336
to
1308b4d
Compare
pkg/util/grace/grace_expectations.go
Outdated
} | ||
|
||
func (r *realGraceExpectations) SatisfiedExpectations(controllerKey string, action Action, graceSeconds int32) (bool, time.Duration) { | ||
r.Lock() |
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.
consider using RLock
klog.Infof("%s start finalising traffic routing", c.Key) | ||
// remove stable service the pod revision selector, so stable service will be selector all version pods. | ||
verify, err := m.restoreStableService(c) | ||
if err != nil || !verify { | ||
if retry, err := m.RestoreStableService(c); err != nil || retry { |
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.
plz add log before each steps in this func
// returning (false, nil) means the update has been submitted, and no error occurred | ||
// but we need to wait graceful time before returning true | ||
func (m *Manager) PatchStableService(c *TrafficRoutingContext) (bool, error) { | ||
func (m *Manager) RemoveCanaryService(c *TrafficRoutingContext) (bool, error) { |
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.
plz comment the return variable
Signed-off-by: yunbo <[email protected]>
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: furykerry The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ⅰ. Describe what this PR does
use a map to store key(resource and action) and value (last modified time), if an operation require a grace period after update, we record the time of update, so that next time we can check if the grace period expires before executing this operation again.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Special notes for reviews