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

Bun doesn't finish the execution when all workers' ports are closed #11760

Open
SunsetTechuila opened this issue Jun 10, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@SunsetTechuila
Copy link
Contributor

SunsetTechuila commented Jun 10, 2024

What version of Bun is running?

1.1.12+43f0913c3

What platform is your computer?

Microsoft Windows NT 10.0.22635.0 x64

What steps can reproduce the bug?

create two files:

caller.mjs

import { Worker } from "worker_threads";

const worker = new Worker("./worker.mjs");
worker.postMessage("");

worker.mjs

import { parentPort } from "worker_threads";

parentPort.on("message", () => {
  parentPort.close();
});

run:

bun caller.mjs

What is the expected behavior?

I expect Bun to finish the execution like Node does:

node caller.mjs

What do you see instead?

[SYS] onStreamRead(0x5957959772864) = 33
[FileReader] onReadChunk() = 33 (progress)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] uv_write(13) = 0
[FileReader] onPull(16384) = 0
[FileReader] onPull(16384) = pending
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[FileSink] onReady()

over and over again

Additional information

It is impossible to generate type declaration files using tsup because of this
Upd: fixed in tsup

@SunsetTechuila SunsetTechuila added bug Something isn't working needs triage labels Jun 10, 2024
@SunsetTechuila SunsetTechuila changed the title Bun doesn't stop the execution when all workers' ports are closed Bun doesn't finish the execution when all workers' ports are closed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants