graphprotocol / graphprotocol/graph-node

[Bug] Memory leak when using block handler without filter

Open
#4,509 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Bug report

For the following subgraph we needed a way to initialize some values (at block 0):
https://github.com/Taraxa-project/taraxa-platform/tree/feature/add-subgraph-for-dpos/packages/dpos-subgraph

When we added a blockHandlers without a filter, it calls the handler for all blocks but the memory increases exponentially until the process is killed due to OOM.

The contents of the handler function doesn't matter. Also tested with an empty function.

Happens in Docker with v0.27.0, v0.28.0, v0.29.0, v0.30

https://user-images.githubusercontent.com/3051409/229186801-46673195-05fa-4f60-baa8-e2c636ee51e0.mp4

Relevant log output

No response

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out
  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
OS information

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the linked dpos-subgraph, a block handler without a filter, and graph-node v0.27.0 through v0.30 in Docker on Linux. Trace the block-handler execution path and verify that an empty handler no longer causes memory to grow until the process is killed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.