Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable forced serialization of error.stack #1581

Open
spion opened this issue Feb 13, 2019 · 6 comments
Open

Ability to disable forced serialization of error.stack #1581

spion opened this issue Feb 13, 2019 · 6 comments

Comments

@spion
Copy link
Collaborator

spion commented Feb 13, 2019

  1. What version of bluebird is the issue happening on?

Most versions since 2.x

  1. What platform and version? (For example Node.js 0.12 or Google Chrome 32)

All platforms

Bluebird forces serialization of error.stack. In test environments with source maps support (for example, jest) this causes test timeouts since bluebird will attempt to read the stack string, blocking the test up to a few seconds.

Test case to reproduce coming soon - in the mean time I wonder what precisely was the original reason that we forced this serialization.

@spion
Copy link
Collaborator Author

spion commented Feb 13, 2019

Previous issues: #1285

@benjamingr
Copy link
Collaborator

Are you talking about Promise.coroutine?

@spion
Copy link
Collaborator Author

spion commented Feb 13, 2019

No, it seems that bluebird might always be forcing serialization of error.stack - I'm not sure yet. I opened a jest issue too jestjs/jest#7879

@petkaantonov
Copy link
Owner

Forced serialization is to avoid memory leak isn't it?

@spion
Copy link
Collaborator Author

spion commented May 24, 2019

Yes, but if there was a way to disable it for test environments, it would probably help. There regardless of whether the stack is actually needed if there is a promise error, it gets force-serialized which is really slow with source maps enabled and times out the first test.

@petkaantonov
Copy link
Owner

I see, could probably create a flag for lazy serialization? PR welcome

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

No branches or pull requests

3 participants