Parameterize startup CRD wait retries#777
Conversation
| } | ||
|
|
||
| // with a Factor of 1.5 we wait up to 7.5 seconds (the 10th attempt) | ||
| maxMs := retryCRDIntervalMax.Milliseconds() |
There was a problem hiding this comment.
Can you add new comments here?
cmd/snapshot-controller/main.go
Outdated
| // with a Factor of 1.5 we wait up to 7.5 seconds (the 10th attempt) | ||
| maxMs := retryCRDIntervalMax.Milliseconds() | ||
| if maxMs < 100 { | ||
| maxMs = 100 |
There was a problem hiding this comment.
What is the relationship between this 100 ms and Duration of 100 * time.Millisecond on line 115?
There was a problem hiding this comment.
Explained in the comment, LMK if it's not clear.
cmd/snapshot-controller/main.go
Outdated
| if maxMs < 100 { | ||
| maxMs = 100 | ||
| } | ||
| steps := int(math.Ceil(math.Log(float64(maxMs)/100) / math.Log(1.5))) |
There was a problem hiding this comment.
This 1.5 here is the same as Factor 1.5 on line 116? Can you use the same parameter if they are the same?
There was a problem hiding this comment.
Yup, explained in the comment.
|
Thanks @xing-yang , lmk if it's still unclear. |
28b1548 to
120721e
Compare
|
In the release note, can you add "in the snapshot-controller" at the end? Can you also document this new flag in README? https://github.com/kubernetes-csi/external-snapshotter#snapshot-controller-command-line-options |
Change-Id: I870a3d294b4d30abea3f6ecad951d68cfd5c9ceb
Done & done! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattcary, xing-yang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a command line flag (retry-crd-interval-max) for the maximum interval to wait for CRDs to appear.
This allows providers to avoid unnecessary crashlooping on startup when it is not unusual for CRDs to take longer than 7 seconds to appear.
/kind feature
/assign @msau42