Limit unbounded channel usage
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- distributed-systems
Research direction
Search Forest for every flume::unbounded usage, beginning with the peer-to-peer path around handle_gossip_event, and review how each channel is used when it reaches its limit. Check the clippy settings as well. Done means every usage is justified or changed to a bounded channel with a sane constant or parameter, and unbounded usage is banned in clippy without introducing deadlocks.
Written by the indexing model from the issue text.
Description
Summary
During recent memory profiling in Forest, we noticed the channels in the peer-to-peer module tend to be unbounded. This could have led to excessive memory usage.
A likely scenario here is that messages in handle_gossip_event get deserialised and put into the network channel. Get enough of such events and the channels could grow quickly, each holding the deserialised message, leading to high memory usage.
This issue is not exclusive to the p2p layer; we should revisit all of the flume::unbounded in Forest and allow it only when it's justified.
Completion Criteria
- re-visit
flume::unboundedusages in Forest; all of them should be either justified or changed toboundedversions, with either constants or parameters with sane defaults. ⚠️ Important! Usage of these channels should also be revisited - pushing to a channel that is at its limits will block; this could lead to a deadlock. - ban the usage of
flume::unboundedin the clippy settings
Additional Links & Resources
- Dominant language
- Rust
- Stars
- 700
- Forks
- 201
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 65
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChainSafe/forest
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Bug
Difficulty 3/5 1-2 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
[automated] `cargo deny check advisories` failure @ 20/11/26 00:01Possibly taken @akaladarshi claimed this today. OpenBug
Difficulty 1/5 Under an hour Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
FIP-0119 implementation in `builtin-actors`Possibly taken @LesnyRumcajs claimed this 2 days ago. OpenType: Task
ChainSafe/forest#7886 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in ChainSafe/forest
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
benchmark-review
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
app-request
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
flatpark/flatpark#1423 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
area:image documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day