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

Nesting deasync cause endless loop, and maybe 100% CPU #158

Open
loynoir opened this issue Nov 10, 2021 · 0 comments
Open

Nesting deasync cause endless loop, and maybe 100% CPU #158

loynoir opened this issue Nov 10, 2021 · 0 comments

Comments

@loynoir
Copy link

loynoir commented Nov 10, 2021

What

  1. Nesting deasync.loopWhile cause endless loop + 100% CPU.
  2. Nesting deasync.sleep cause endless loop.

Reproduce

https://github.com/loynoir/reproduce-deasync-158.js

Reproduce

$ git clone https://github.com/loynoir/reproduce-deasync-158.js
$ npm install
$ npm test

Actual

$ reproduce_deasync_158_cpu=1 pnpm test
... // No output, 100% CPU.

$ unset reproduce_deasync_158_cpu
$ npm test
index.cjs waiting for ./index.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
plugin.cjs waiting for ./dependency.mjs
... // endless

Expected

No endlessloop. No 100% CPU.

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

No branches or pull requests

1 participant