Skip to content

Commit 924a906

Browse files
Manav-AggarwalGanesha Upadhyaya
authored andcommitted
Stop indexer service in full node OnStop method (#1351)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview Closes: #1352 Fixes write to file after node stopped panics that were leading to flaky failing CI tests. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. --> ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Ensured that the Indexer Service properly stops when the Full Node is stopped, improving resource management and stability. - **Documentation** - Updated the documentation to reflect the change in lifecycle management of the Indexer Service in relation to the Full Node. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent aa3dd3f commit 924a906

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

node/full.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ func (n *FullNode) OnStop() {
361361
err = multierr.Append(err, n.p2pClient.Close())
362362
err = multierr.Append(err, n.hSyncService.Stop())
363363
err = multierr.Append(err, n.bSyncService.Stop())
364+
err = multierr.Append(err, n.IndexerService.Stop())
364365
n.Logger.Error("errors while stopping node:", "errors", err)
365366
}
366367

state/indexer-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Indexer service indexes transactions and blocks using events emitted by the
66

77
## Protocol/Component Description
88

9-
The Indexer service consists of three main components: an event bus, a transaction indexer and a block indexer.
9+
The Indexer service is started and stopped along with a Full Node. It consists of three main components: an event bus, a transaction indexer and a block indexer.
1010

1111
### Event Bus
1212

0 commit comments

Comments
 (0)