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

fix: lotus-provider: send errs then retries despite being sent #11492

Closed
wants to merge 1 commit into from

Conversation

snadrus
Copy link
Collaborator

@snadrus snadrus commented Dec 6, 2023

Related Issues

Proposed Changes

  1. Fix a SQL query bug that was erroring out Send() after sending, causing weird retry.
  2. Added a backstop to stop retrying a send when the error is that it's already sent.

Additional Info

Checklist

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

  • Commits have a clear commit message.
  • 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, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@snadrus snadrus requested a review from a team as a code owner December 6, 2023 15:20
@snadrus snadrus requested a review from rjan90 December 6, 2023 15:23
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.

This is still incorrect

@@ -281,7 +281,7 @@ func NewSender(api SenderAPI, signer SignerAPI, db *harmonydb.DB) (*Sender, *Sen
// API nodes
//
// Send is also currently more strict about required parameters than MpoolPushMessage
func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageSendSpec, reason string) (cid.Cid, error) {
func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageSendSpec, reason string, taskID harmonytask.TaskID) (cid.Cid, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This task id is not what should go into the message_sends table

@@ -350,7 +350,10 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS
var sigCidStr, sendError string
var sendSuccess *bool

err = s.db.QueryRow(ctx, `select signed_cid, send_success, send_error from message_sends where send_task_id = $1`, taskAdder).Scan(&sigCidStr, &sendSuccess, &sendError)
err = s.db.QueryRow(ctx, `
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, we should be persisting the taskID in the call to taskAdder a few lines above - this is the ID of the message send task (which is separate from the recover/submit task IDs)

@snadrus snadrus closed this Dec 6, 2023
@magik6k magik6k changed the title fix: send errs then retries despite being sent fix: lotus-provider: send errs then retries despite being sent Dec 6, 2023
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.

3 participants