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

Merge master into soroban-xdr-next #4998

Merged
merged 56 commits into from
Jul 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
60a5dd1
Bump golang.org/x/text from 0.3.7 to 0.3.8
dependabot[bot] Feb 27, 2023
3274d0f
all: enforce simplified Golang code (#4852)
2opremio Apr 20, 2023
d795eee
Update completed sprint on issue/pr closed (#4857)
Apr 27, 2023
35250fe
Bump core image to latest stable release v19.10.0
mbsdf May 2, 2023
d92f1f5
Merge pull request #4862 from mbsdf/core_stable_v19.10.0
marta-lokhova May 3, 2023
c05dcf6
Add a simple test for asset case sorting in ascii (#4876)
May 19, 2023
148bf79
services/horizon: Suppress Core timeout error (#4860)
urvisavla May 19, 2023
928281e
Update CHANGELOG.md for latest release (#4828)
stellarsaur May 22, 2023
7a7b140
Bump core image to latest release v19.11.0 (#4885)
mbsdf May 31, 2023
b060996
services/horizon: Protect 'currentState' variable using Mutex to prev…
urvisavla Jun 5, 2023
da99d59
services/horizon: Update default for --captive-core-use-db to true (…
urvisavla Jun 6, 2023
060fd7a
services/horizon: Improve error handling for when stellar-core crashe…
urvisavla Jun 15, 2023
1c1800a
Parse LIMIT_TX_QUEUE_SOURCE_ACCOUNT in core config
mollykarcher Jun 16, 2023
01c7aa3
Merge pull request #4912 from mollykarcher/molly/main/limit-act-tx-le…
mollykarcher Jun 16, 2023
d2d01d3
updated changelog for 2.26.0 release notes
sreuland Jun 20, 2023
38dac4e
Pinning and updates golang and ubuntu images
mollykarcher Jun 16, 2023
34484c6
Merge pull request #4918 from mollykarcher/molly/master/versions
mollykarcher Jun 22, 2023
9e32d8c
services/horizon: Fix ledger endpoint url in HAL (#4928)
urvisavla Jun 22, 2023
5c8be8b
Merge branch 'master' into dependabot/go_modules/golang.org/x/text-0.3.8
mollykarcher Jun 23, 2023
23e8c63
Merge branch 'release-horizon-v2.26.0' into merge_2.26_rel_notes
sreuland Jun 23, 2023
090b454
Merge pull request #4931 from sreuland/merge_2.26_rel_notes
sreuland Jun 23, 2023
7aafb6d
Goreplay middleware (#4932)
urvisavla Jun 27, 2023
ff665ec
all: Fix improper use of errors.Wrap (#4926)
bartekn Jun 27, 2023
2ec1834
fix apt repo reference to focal now (#4929)
sreuland Jun 29, 2023
2cc9b7e
services/horizon: Remove command line flag --remote-captive-core-url …
urvisavla Jul 5, 2023
b423da2
Small changes - 1
aditya1702 Jul 10, 2023
7feb2f8
Remove ingestion filtering flag
aditya1702 Jul 11, 2023
c72eaea
Merge branch 'master' into dependabot/go_modules/golang.org/x/text-0.3.8
mollykarcher Jul 12, 2023
87c156c
Merge pull request #4775 from stellar/dependabot/go_modules/golang.or…
mollykarcher Jul 12, 2023
b7b898f
services/horizon: Fix Horizon connectivity to core in standalone dock…
urvisavla Jul 12, 2023
9a7105a
Bump core image to latest release v19.12.0 (#4953)
mbsdf Jul 12, 2023
8f40348
Add new function HideFlag
aditya1702 Jul 12, 2023
0db2082
Merge branch 'master' into remove-ingestion-filtering-flag
aditya1702 Jul 13, 2023
97778ed
Fix lint warnings
aditya1702 Jul 13, 2023
95c2976
services/horizon: Add optional configuration parameter NETWORK (#4949)
urvisavla Jul 18, 2023
ba1fad9
Merge branch 'master' into remove-ingestion-filtering-flag
aditya1702 Jul 18, 2023
245f973
Update flags.go
aditya1702 Jul 18, 2023
928a109
Add IsHidden variable
aditya1702 Jul 19, 2023
f4832f3
Update IsHidden
aditya1702 Jul 19, 2023
56d443c
Remove individual IsHidden option
aditya1702 Jul 19, 2023
3213ffa
Change to Hidden
aditya1702 Jul 20, 2023
f706537
Add tests for ingestion-filtering cmd flag
aditya1702 Jul 20, 2023
d7867e4
Make changes - 1
aditya1702 Jul 20, 2023
20dfa4e
Make changes - 2
aditya1702 Jul 21, 2023
bcfa5cb
Remove race condition in test
aditya1702 Jul 21, 2023
5f98d85
Update command_line_args_test.go
aditya1702 Jul 21, 2023
281390c
Update command_line_args_test.go
aditya1702 Jul 24, 2023
e8ed7fb
Update command_line_args_test.go
aditya1702 Jul 24, 2023
075f00a
Update command_line_args_test.go
aditya1702 Jul 24, 2023
c83e4be
Merge pull request #4955 from aditya1702/remove-ingestion-filtering-flag
aditya1702 Jul 24, 2023
990078d
Services/horizon: Skip querying stellar-core on 127.0.0.1 when Horizo…
urvisavla Jul 27, 2023
af7f09c
Resolve Horizon CI failures caused by the failure to install the righ…
urvisavla Jul 27, 2023
43541de
Merge remote-tracking branch 'origin/master' into merge-master-xdr-next
2opremio Jul 28, 2023
62bc09d
Fix race condition in integration test (#4994)
aditya1702 Jul 28, 2023
e2f59bf
Extend timeout for integration tests
2opremio Jul 28, 2023
1179bac
Merge remote-tracking branch 'origin/master' into merge-master-xdr-next
2opremio Jul 28, 2023
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
8 changes: 7 additions & 1 deletion services/horizon/internal/ingest/main.go
Original file line number Diff line number Diff line change
@@ -230,7 +230,8 @@ type system struct {

reapOffsets map[string]int64

currentState State
currentStateMutex sync.Mutex
currentState State
}

func NewSystem(config Config) (System, error) {
@@ -484,6 +485,8 @@ func (s *system) initMetrics() {
}

func (s *system) GetCurrentState() State {
s.currentStateMutex.Lock()
defer s.currentStateMutex.Unlock()
return s.currentState
}

@@ -652,7 +655,10 @@ func (s *system) runStateMachine(cur stateMachineNode) error {
panic("unexpected transaction")
}

s.currentStateMutex.Lock()
s.currentState = cur.GetState()
s.currentStateMutex.Unlock()

next, err := cur.run(s)
if err != nil {
logger := log.WithFields(logpkg.F{
41 changes: 41 additions & 0 deletions services/horizon/internal/ingest/main_test.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import (
"context"
"database/sql"
"testing"
"time"

"github.com/jmoiron/sqlx"
"github.com/prometheus/client_golang/prometheus"
@@ -242,6 +243,46 @@ func TestMaybeVerifyInternalDBErrCancelOrContextCanceled(t *testing.T) {
historyQ.AssertExpectations(t)
}

func TestCurrentStateRaceCondition(t *testing.T) {
historyQ := &mockDBQ{}
s := &system{
historyQ: historyQ,
ctx: context.Background(),
}

historyQ.On("GetTx").Return(nil)
historyQ.On("Begin").Return(nil)
historyQ.On("Rollback").Return(nil)
historyQ.On("GetLastLedgerIngest", s.ctx).Return(uint32(1), nil)
historyQ.On("GetIngestVersion", s.ctx).Return(CurrentVersion, nil)

timer := time.NewTimer(2000 * time.Millisecond)
getCh := make(chan bool, 1)
doneCh := make(chan bool, 1)
go func() {
var state = buildState{checkpointLedger: 8,
skipChecks: true,
stop: true}
for range getCh {
_ = s.runStateMachine(state)
}
close(doneCh)
}()

loop:
for {
s.GetCurrentState()
select {
case <-timer.C:
break loop
default:
}
getCh <- true
}
close(getCh)
<-doneCh
}

type mockDBQ struct {
mock.Mock