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

feat: message: Add retries to mpool push message from lotus miner #9177

Merged
merged 16 commits into from
Aug 29, 2022

Conversation

shrenujbansal
Copy link
Contributor

@shrenujbansal shrenujbansal commented Aug 17, 2022

Related Issues

#9171

Proposed Changes

Add retries to mpool push message API in case of unavailability of the lotus chain node

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@shrenujbansal shrenujbansal requested a review from a team as a code owner August 17, 2022 19:16
go.mod Outdated Show resolved Hide resolved
lib/retry/retry.go Outdated Show resolved Hide resolved
lib/retry/retry.go Outdated Show resolved Hide resolved
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Logic looks good, 2 small comments on the test

"github.com/filecoin-project/lotus/lib/retry"
)

func TestRetryErrorIsInTrue(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.

itests/ is really just for integration tests which require running test nodes. This test can be in lib/retry/retry_test.go; CI will still run that with other unit tests


func TestRetryErrorIsInTrue(t *testing.T) {
errorsToRetry := []error{&jsonrpc.RPCConnectionError{}}
require.True(t, retry.ErrorIsIn(&jsonrpc.RPCConnectionError{}, errorsToRetry))
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to also test a wrapped error - something like require.True(t, retry.ErrorIsIn(xerrors.Errorf("wrapped: %w", &jsonrpc.RPCConnectionError{}), errorsToRetry))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point

@magik6k
Copy link
Contributor

magik6k commented Aug 26, 2022

There also are some other Go 1.17 references that possibly need updating; this is what seems important on master:

testplans/lotus-soup/go.mod
3:go 1.17

testplans/docker-images/Dockerfile.oni-runtime-debug
1:ARG GO_VERSION=1.17.9

testplans/docker-images/Dockerfile.oni-runtime
1:ARG GO_VERSION=1.17.9

testplans/docker-images/Dockerfile.oni-buildbase
1:ARG GO_VERSION=1.17.9

testplans/composer/Dockerfile
1:FROM golang:1.17.9-buster as tg-build

README.md
13:  <a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.17-blue.svg" /></a>
74:To build Lotus, you need a working installation of [Go 1.17.9 or higher](https://golang.org/dl/):
77:wget -c https://golang.org/dl/go1.17.9.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local

Makefile
13:$(error Update Golang to version to at least 1.17.9)

Dockerfile.lotus
1:FROM golang:1.17.9-buster AS builder-deps

Makefile Show resolved Hide resolved
@magik6k magik6k enabled auto-merge August 29, 2022 07:06
@magik6k magik6k merged commit 28722de into master Aug 29, 2022
@magik6k magik6k deleted the 9171-add-retries-to-mpool-push-message branch August 29, 2022 07:24
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.

2 participants