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

Implement better retry logic on failed queries #4

Open
alexanderbez opened this issue Jun 20, 2019 · 0 comments
Open

Implement better retry logic on failed queries #4

alexanderbez opened this issue Jun 20, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@alexanderbez
Copy link
Collaborator

Currently the worker naively retries every failed export:

// start starts a worker by listening for new jobs (block heights) from the
// given worker queue. Any failed job is logged and re-enqueued.
func (w worker) start() {
	for i := range w.queue {
		if err := w.process(i); err != nil {
			// re-enqueue any failed job
			// TODO: Implement exponential backoff or max retries for a block height.
			go func() {
				log.Printf("re-enqueueing failed block %d\n", i)
				w.queue <- i
			}()
		}
	}
}

A better approach is needed to not continuously retry the same heights.

@alexanderbez alexanderbez added the enhancement New feature or request label Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant