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

add entry to modify the retry times in QueueWorker #324

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/apiregister-gen/generators/controller_generator.go
Expand Up @@ -114,6 +114,11 @@ func (c *{{.Target.Kind}}Controller) GetName() string {
return c.Name
}

// change the retry time at runtime
func (c *{{.Target.Kind}}Controller) SetRetryTimes(r int) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than a setter, plz add another constructor func to avoid thread-safety issue, like NewBucketControllerWithMaxRetries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. It would be better to do this. It will be user's responsibility to add such a function. And it will be unnecessary to add function here.
My fault and will close it.
Thanks!

c.queue.MaxRetries = r
}

func (c *{{.Target.Kind}}Controller) LookupAndReconcile(key string) (err error) {
return c.reconcile(key)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_etcd.sh
Expand Up @@ -7,7 +7,7 @@ ETCD_VER=v3.2.0
# choose either URL
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/coreos/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
DOWNLOAD_URL=${GITHUB_URL}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GOOGLE_URL is invalid. The travis is always failed with google url. To make travis pass, use github url instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be flakiness from the download link, let's revert and see what'll happen


rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
rm -rf /tmp/test-etcd && mkdir -p /tmp/test-etcd
Expand Down