Skip to content

HotFix for Critical sync error: RangeError: Maximum call stack size exceeded#4969

Merged
mnaamani merged 1 commit intoJoystream:masterfrom
mnaamani:colossus-sync-hotfix
Nov 21, 2023
Merged

HotFix for Critical sync error: RangeError: Maximum call stack size exceeded#4969
mnaamani merged 1 commit intoJoystream:masterfrom
mnaamani:colossus-sync-hotfix

Conversation

@mnaamani
Copy link
Copy Markdown
Member

We had a case where a new storage node was doing an initial sync. The number of objects to sync was around 380,000.
Sync tasks being added was using pattern Array.push(...tasks) this results in a call to Array.push(....) with 380,000 arguments which are all added to the javascript call stack which throws an exception, this resulted in the node never being able to complete a sync run.

The fix is to just iterate over the tasks array elements and push them individually into the target array.

Copy link
Copy Markdown
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for investigating & fixing this issue. Just a related point, I think we use the spread operator notation (i/e....tasks) in a number of places, so maybe we should find all the occurrences and add fixes (But that for some other task I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants