fix(txm): heap out of memory#573
Merged
GabrielMartinezRodriguez merged 2 commits intoApr 13, 2025
Merged
Conversation
This was referenced Mar 28, 2025
Merged
Merged
Merged
Contributor
Author
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a heap out of memory issue in the BlockMonitor module by refining the block reset logic.
- Adds checks to clear an existing block timeout before scheduling a new one.
- Ensures proper cleanup of the unwatch callback before rescheduling block monitor start.
c9da31c to
531b84c
Compare
24ecb5b to
1a9913d
Compare
531b84c to
d9ca14c
Compare
This was referenced Mar 31, 2025
Merged
Merged
aodhgan
approved these changes
Apr 1, 2025
1a9913d to
be3a812
Compare
d9ca14c to
0563ec5
Compare
be3a812 to
f709674
Compare
f8961b8 to
4b1dec2
Compare
aa20cdc to
34ecd78
Compare
49ca1f5 to
98ddf67
Compare
34ecd78 to
a5a0a16
Compare
98ddf67 to
7d6b4d7
Compare
a5a0a16 to
7bd96c6
Compare
7d6b4d7 to
c0e9e96
Compare
7bd96c6 to
1952e64
Compare
c0e9e96 to
709b75c
Compare
1952e64 to
ff6ba03
Compare
709b75c to
538a0a1
Compare
ff6ba03 to
9b6be7f
Compare
538a0a1 to
93e241c
Compare
cf6a8e8 to
d388440
Compare
11 tasks
42bc0db to
ceb064f
Compare
d388440 to
3e362df
Compare
ceb064f to
7a35565
Compare
3e362df to
48d79d7
Compare
48d79d7 to
d3a8679
Compare
This was referenced Apr 21, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This PR solves an issue that causes the TXM to crash whenever there's a connection problem with the node due to a heap out-of-memory error. The crash was happening because timers were not being cleared, and while the node was down, we entered an infinite loop:
onError -> resetBlockSubscription -> start -> onError. In each iteration, we left timers uncleared, quickly filling up the 4GB heap available to the process.To fix this, we now clear the timers on every iteration. Additionally, we wait 500ms before retrying the connection to give the node some time to recover
In this chart, you can see the process uptime. Every time it drops to zero, it indicates a restart, which was caused by this issue
Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
testnet, mainnet, standalone wallet, ...).
< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >
< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
comments.
in a Markdown document.
packages/coreandpackages/react), see here for more info.