HotFix for Critical sync error: RangeError: Maximum call stack size exceeded#4969
Merged
mnaamani merged 1 commit intoJoystream:masterfrom Nov 21, 2023
Merged
Conversation
zeeshanakram3
approved these changes
Nov 21, 2023
Contributor
zeeshanakram3
left a comment
There was a problem hiding this comment.
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).
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.
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 toArray.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.