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

soroban-rpc: remove noisy rollback message #1052

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions cmd/soroban-rpc/internal/ingest/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"github.com/stellar/go/historyarchive"
"github.com/stellar/go/ingest"
backends "github.com/stellar/go/ingest/ledgerbackend"
supportdb "github.com/stellar/go/support/db"
"github.com/stellar/go/support/log"
"github.com/stellar/go/xdr"

Expand Down Expand Up @@ -208,9 +209,14 @@
if err != nil {
return err
}
transactionCommitted := false
defer func() {
if err := tx.Rollback(); err != nil {
s.logger.WithError(err).Warn("could not rollback fillEntriesFromCheckpoint write transactions")
if transactionCommitted == false {

Check failure on line 214 in cmd/soroban-rpc/internal/ingest/service.go

View workflow job for this annotation

GitHub Actions / golangci

S1002: should omit comparison to bool constant, can be simplified to `!transactionCommitted` (gosimple)
tsachiherman marked this conversation as resolved.
Show resolved Hide resolved
// Internally, we might already have rolled back the transaction. We should
// not generate benign error/warning here in case the transaction was already rolled back.
if err := tx.Rollback(); err != nil && err != supportdb.ErrAlreadyRolledback {

Check failure on line 217 in cmd/soroban-rpc/internal/ingest/service.go

View workflow job for this annotation

GitHub Actions / golangci

shadow: declaration of "err" shadows declaration at line 203 (govet)
tsachiherman marked this conversation as resolved.
Show resolved Hide resolved
s.logger.WithError(err).Warn("could not rollback fillEntriesFromCheckpoint write transactions")
}
}
}()

Expand All @@ -222,9 +228,12 @@
}

s.logger.Info("committing checkpoint ledger entries")
if err := tx.Commit(checkpointLedger); err != nil {
err = tx.Commit(checkpointLedger)
transactionCommitted = true
if err != nil {
return err
}

s.logger.Info("finished checkpoint processing")
return nil
}
Expand Down
Loading