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

node: net servers are swallowing errors and hanging the process #2596

Closed
cjihrig opened this issue Sep 1, 2022 · 1 comment
Closed

node: net servers are swallowing errors and hanging the process #2596

cjihrig opened this issue Sep 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@cjihrig
Copy link
Contributor

cjihrig commented Sep 1, 2022

Describe the bug
If an exception is thrown from the handler of a running server, the process hangs and no error is reported. If the server is closed prior to throwing the exception, the process terminates, but the error is not displayed.

Steps to Reproduce
Run the following script. The server.close() call can optionally be uncommented.

import net from "./node/net.ts";

const server = net.createServer((socket) => {
  // server.close();
  throw new Error("bye");
}).listen(0, "127.0.0.1", () => {
  const client = net.createConnection(server.address().port, "127.0.0.1")

  client.on("connect", () => {
    client.end();
  });
});

Expected behavior
The process should exit with a stack trace.

Environment

  • OS: macOS
  • deno version: 1.25.0
  • std version: 0.153.0
@lucacasonato
Copy link
Member

Maybe related: denoland/deno#15869

@cjihrig cjihrig closed this as completed Dec 6, 2022
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

3 participants