Skip to content

Implement retry mechanism for read endpoints#31

Closed
LINCKODE wants to merge 3 commits intodevfrom
29-retry-mechanism-for-read-operations
Closed

Implement retry mechanism for read endpoints#31
LINCKODE wants to merge 3 commits intodevfrom
29-retry-mechanism-for-read-operations

Conversation

@LINCKODE
Copy link
Member

Add retry mechanism for all endpoints that request data from nodes and update vulnerable dependencies.

@LINCKODE LINCKODE linked an issue Jan 23, 2025 that may be closed by this pull request
@LINCKODE LINCKODE requested review from 0xluk and qubicmio January 23, 2025 13:35
@qubicmio
Copy link
Member

lgtm (except the retry code duplication - not sure if there is a way to make that nicer)

@0xluk
Copy link
Collaborator

0xluk commented Jan 24, 2025

lgtm (except the retry code duplication - not sure if there is a way to make that nicer)

@qubicmio I addressed that in the review


func NewServer(listenAddrGRPC, listenAddrHTTP string, logger *log.Logger,
qPool *qubic.Pool, maxTickFetchUrl string, readRetryCount int) *Server {
func NewServer(listenAddrGRPC, listenAddrHTTP string, logger *log.Logger, qPool *qubic.Pool, maxTickFetchUrl string, readRetryCount int) *Server {
Copy link
Collaborator

Choose a reason for hiding this comment

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

readRetryCount is not a proper variable time as from a config point of view it's not a count but a readMaxRetries

return 0, errors.Wrap(err, "performing request")
}
defer res.Body.Close()
for attempt := 0; attempt <= maxRetries; attempt++ {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be attempt < maxRetries

HttpHost string `conf:"default:0.0.0.0:8000"`
GrpcHost string `conf:"default:0.0.0.0:8001"`
MaxTickFetchUrl string `conf:"default:http://127.0.0.1:8080/max-tick"`
ReadRetryCount int `conf:"default:5"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, it's not a count

@0xluk 0xluk closed this Nov 28, 2025
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.

retry mechanism for read operations

3 participants