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 retry for graph node #471

Merged
merged 5 commits into from
Apr 12, 2024
Merged

Conversation

mooselumph
Copy link
Contributor

Why are these changes needed?

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@mooselumph mooselumph requested a review from bxue-l2 April 11, 2024 01:03
@mooselumph mooselumph marked this pull request as ready for review April 11, 2024 20:24
core/thegraph/querier.go Outdated Show resolved Hide resolved
core/thegraph/config.go Outdated Show resolved Hide resolved
}
retryCount++

err := q.GraphQLQuerier.Query(ctx, query, variables)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe in a future PR, but it should check err and only retry on transient errors (429/5xx). If the request itself is invalid, retries shouldn't be made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not really sure how to tell in this case. Going to leave this for a future PR.

core/thegraph/config.go Outdated Show resolved Hide resolved
core/thegraph/querier.go Outdated Show resolved Hide resolved
disperser/batcher/encoding_streamer.go Outdated Show resolved Hide resolved
return args.Error(0)
}

func TestRetryQuerier_Query(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it conventional to use underscore in golang naming?

@mooselumph mooselumph merged commit b215782 into Layr-Labs:master Apr 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants