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

QUIC ping doesn't function properly #36462

Closed
battall opened this issue Dec 9, 2020 · 1 comment
Closed

QUIC ping doesn't function properly #36462

battall opened this issue Dec 9, 2020 · 1 comment
Labels
quic Issues and PRs related to the QUIC implementation / HTTP/3.

Comments

@battall
Copy link

battall commented Dec 9, 2020

What steps will reproduce the bug?

const socket = net.createQuicSocket({ endpoint: { port: 555 } });

socket
  .on("session", (session) => {
    console.time("close");
    session.on("close", () => {
      console.timeEnd("close");
      console.log("close but why?", session.idleTimeout);
      // Output:
    });
  })
  .listen({
    alpn: "tunnel",
    key: fs.readFileSync(process.env.TLS_KEY_PATH, "utf8"),
    cert: fs.readFileSync(process.env.TLS_CERT_PATH, "utf8"),
    ca: fs.readFileSync(process.env.TLS_CA_PATH, "utf8"),
  });

socket
  .connect({
    address: "127.0.0.1",
    port: 555,
    alpn: "tunnel",
  })
  .then((session) => {
    setInterval(() => session.ping(), 100);
    session.openStream().then((stream) => {
      // Send data after 15 seconds
      setTimeout(() => {
        stream.write("hi");
      }, 15 * 1000);
    });
  });

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

session.ping() should reset idle timeout as said in docs
https://nodejs.org/api/quic.html#quic_quicsession_ping
but it does not reset timeout, session still ends after 10 seconds

What do you see instead?

node:internal/quic/core:2136
      throw new ERR_INVALID_STATE(
      ^

Error [ERR_INVALID_STATE]: Invalid state: QuicClientSession is already destroyed
    at new NodeError (node:internal/errors:278:15)
    at QuicClientSession.ping (node:internal/quic/core:2136:13)
    at Timeout._onTimeout (/home/debian/localport-server/test.js:34:31)
    at listOnTimeout (node:internal/timers:556:17)
    at processTimers (node:internal/timers:499:7) {
  code: 'ERR_INVALID_STATE'
}

Additional information

@battall battall changed the title QUIC Idle Timeout does not function properly QUIC ping doesn't function properly Dec 9, 2020
@jasnell jasnell added the quic Issues and PRs related to the QUIC implementation / HTTP/3. label Dec 9, 2020
@jasnell
Copy link
Member

jasnell commented Feb 1, 2021

Closing as no longer relevant since the quic bits were removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quic Issues and PRs related to the QUIC implementation / HTTP/3.
Projects
None yet
Development

No branches or pull requests

2 participants