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

ongoing fetch will cause cpu 100% #145

Open
denghongcai opened this issue Oct 23, 2024 · 4 comments
Open

ongoing fetch will cause cpu 100% #145

denghongcai opened this issue Oct 23, 2024 · 4 comments

Comments

@denghongcai
Copy link
Contributor

run code below in MacOS arm64. build wasmedge-quickjs from latest main branch, and use wasmedge 0.14.1

import { fetch } from 'http';

async function test_fetch() {
  try {
    print('test_fetch start');
    let r = await fetch('https://httpbin.org/delay/10');
    print('test_fetch\n', await r.text());
  } catch (e) {
    print(e);
  }
}

test_fetch();

during the fetch progress, seems there is a infinity loop
image

@L-jasmine
Copy link
Collaborator

Although I have tried to fix this issue many times, it still has not been resolved. The underlying reason is that during the wasi poll, I continuously receive a writable status, but what I actually expect is a readable status.

I thought I had fixed it before, but it seems that’s not the case. I will keep trying.

@denghongcai
Copy link
Contributor Author

WasmEdge/wasmedge_hyper_demo#11

I found a similar problem. And I traverse wasmedge-quickjs code, the code call wasi poll through wasi_tokio?

@denghongcai
Copy link
Contributor Author

I use example here https://github.com/WasmEdge/wasmedge_reqwest_demo

same behavior... sad, nothing about wasmedge-quickjs

@L-jasmine
Copy link
Collaborator

We found that this issue is caused by an incorrect implementation of wasi_poll in the WasmEdge runtime on macOS. The WasmEdge runtime is being fixed.

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

2 participants