Skip to content

Conversation

@darioush
Copy link

@darioush darioush commented Apr 15, 2024

I think we can wait for the eventually to pass before closing the chain to avoid adding a sleep

@darioush darioush changed the title fix unindexor in state sync avoids using sleep in test Apr 15, 2024
@darioush darioush changed the title avoids using sleep in test tx indexer fix: avoids using sleep in test Apr 15, 2024
if head := bc.CurrentBlock(); head != nil && head.Number.Uint64() > txLookupLimit {
done = make(chan struct{})
tail := rawdb.ReadTxIndexTail(bc.db)
bc.wg.Add(1)
Copy link
Author

Choose a reason for hiding this comment

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

alternatively I think we can check if done != nil { ... } like its done in bc.quit, but also wg seems fine.

@darioush darioush marked this pull request as ready for review April 16, 2024 18:27
@darioush darioush requested a review from ceyonur as a code owner April 16, 2024 18:27
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Darioush Jalali added 2 commits April 16, 2024 19:58
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
@ceyonur ceyonur merged commit 26e6a34 into tx-indexing-fix Apr 17, 2024
@ceyonur ceyonur deleted the tx-indexing-fix-nosleep branch April 17, 2024 12:26
ceyonur added a commit that referenced this pull request Apr 17, 2024
* fix unindexor in state sync

* fix lint

* fix flaky test

* Update core/blockchain_test.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* fix reviews

* readd delay for index init

* Update core/rawdb/accessors_state_sync.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* tx indexer fix: avoids using sleep in test (#1151)

* avoids using sleep in test

* track all goroutines

* trying harder

* add some debug information in case of fail

* Update core/blockchain.go

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

* Update core/blockchain.go

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

---------

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

---------

Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
github-merge-queue bot pushed a commit that referenced this pull request Sep 15, 2025
Co-authored-by: Austin Larson <78000745+alarso16@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants