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

fix(engine): cleanup leaked context #13749

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented Jan 9, 2025

After the introduction on std::thread::scope for creating StateRootTask, we started using Box::leak to keep alive values required to return and move around the state hook closure. The changes in this PR clean up the leaked data after it has been used, will prevent warnings like:

WARN Long-lived read transaction has been timed out

@fgimenez fgimenez added A-blockchain-tree Related to sidechains, reorgs and pending blocks C-perf A change motivated by improving speed, memory usage or disk footprint labels Jan 9, 2025
@fgimenez fgimenez marked this pull request as ready for review January 9, 2025 10:33
@fgimenez fgimenez requested a review from shekhirin January 9, 2025 10:34
Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

This works

@fgimenez fgimenez added this pull request to the merge queue Jan 9, 2025
@fgimenez fgimenez removed this pull request from the merge queue due to a manual request Jan 9, 2025
@fgimenez fgimenez force-pushed the fgimenez/cleanup-leaked-context branch 2 times, most recently from 85afa6f to fbb8a38 Compare January 10, 2025 18:15
@fgimenez fgimenez force-pushed the fgimenez/cleanup-leaked-context branch from 7ebcaa8 to 227dc8b Compare January 12, 2025 15:33
Copy link

codspeed-hq bot commented Jan 12, 2025

CodSpeed Performance Report

Merging #13749 will degrade performances by 15.18%

Comparing fgimenez/cleanup-leaked-context (227dc8b) with main (567d5c6)

Summary

❌ 4 regressions
✅ 73 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main fgimenez/cleanup-leaked-context Change
hash builder[init size 10000 | update size 100 | num updates 10] 84.1 ms 94.2 ms -10.69%
hash builder[init size 10000 | update size 100 | num updates 1] 9 ms 10.6 ms -15.18%
hash builder[init size 10000 | update size 100 | num updates 3] 26.8 ms 30.6 ms -12.33%
hash builder[init size 10000 | update size 100 | num updates 5] 43.8 ms 50.7 ms -13.66%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants