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

Register VM and snowman metrics after chain creation #3489

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Oct 23, 2024

Why this should be merged

Metrics of VM and snowman should be registered only after the objects they are measuring/monitoring have been constructed in the first place.

How this works

Moves metrics registration to after corresponding object creation

How this was tested

CI

@yacovm
Copy link
Contributor Author

yacovm commented Oct 23, 2024

Doesn't work:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x10389bb93]

goroutine 1 [running]:
github.com/ava-labs/avalanchego/snow/networking/sender.New(0xc0003276b0, {0x156d89f10, 0xc0000bd4a0}, {0x156d8d708, 0xc00065cc60}, {0x104e574a8, 0xc0000fb500}, {0x104e55ec0, 0xc0008afbc0}, 0x2, ...)
        /Users/yacov.manevich/avalanchego/snow/networking/sender/sender.go:78 +0x2b3
github.com/ava-labs/avalanchego/chains.(*manager).createSnowmanChain(0xc000653908, 0xc0003276b0, {0xc003182000, 0x432d6c, 0x866000}, {0x104e5b910, 0xc0003ed5c0}, {0x104e5b910, 0xc00177c3c0}, {0x156d8d660, ...}, ...)
        /Users/yacov.manevich/avalanchego/chains/manager.go:1097 +0x3e5
github.com/ava-labs/avalanchego/chains.(*manager).buildChain(0xc000653908, {{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}, ...)
        /Users/yacov.manevich/avalanchego/chains/manager.go:568 +0xcd5
github.com/ava-labs/avalanchego/chains.(*manager).createChain(0xc000653908, {{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
        /Users/yacov.manevich/avalanchego/chains/manager.go:388 +0x346
github.com/ava-labs/avalanchego/chains.(*manager).StartChainCreator(0xc000653908, {{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
        /Users/yacov.manevich/avalanchego/chains/manager.go:1490 +0xa5
github.com/ava-labs/avalanchego/node.(*Node).initChains(0xc000005508, {0xc003182000, 0x432d6c, 0x866000})
        /Users/yacov.manevich/avalanchego/node/node.go:928 +0x175
github.com/ava-labs/avalanchego/node.New(0xc00133a008, {0x104e53a58, 0xc0002a6100}, {0x104e5b998, 0xc001488080})
        /Users/yacov.manevich/avalanchego/node/node.go:274 +0x181d
github.com/ava-labs/avalanchego/app.New({{{0x6fc23ac00, 0x6fc23ac00, 0x6fc23ac00, 0x1bf08eb000}, {{0x0, 0x0}, 0x0, 0x1, 0x0, 0x1, ...}, ...}, ...})
        /Users/yacov.manevich/avalanchego/app/app.go:73 +0x485
main.main()
        /Users/yacov.manevich/avalanchego/main/main.go:64 +0x4a5

@yacovm yacovm closed this Oct 23, 2024
chains/manager.go Outdated Show resolved Hide resolved
@yacovm yacovm reopened this Oct 23, 2024
@yacovm yacovm force-pushed the cleanup_metrics2 branch 5 times, most recently from d6f3d45 to 9577892 Compare October 23, 2024 22:25
Metrics of VM and snowman should be registered only after the objects they are measuring/monitoring have been constructed in the first place.

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
@StephenButtolph StephenButtolph added the cleanup Code quality improvement label Oct 24, 2024
@StephenButtolph StephenButtolph added this to the v1.11.13 milestone Oct 24, 2024
@StephenButtolph StephenButtolph added this pull request to the merge queue Oct 24, 2024
Merged via the queue into ava-labs:master with commit 993d169 Oct 24, 2024
23 checks passed
yacovm added a commit to yacovm/avalanchego that referenced this pull request Oct 25, 2024
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
yacovm added a commit to yacovm/avalanchego that referenced this pull request Oct 25, 2024
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants