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: stats assertion on close #35892

Closed
splitice opened this issue Oct 31, 2020 · 2 comments
Closed

quic: stats assertion on close #35892

splitice opened this issue Oct 31, 2020 · 2 comments
Labels
quic Issues and PRs related to the QUIC implementation / HTTP/3.

Comments

@splitice
Copy link

  • Version: 15.0.1
  • Platform: x64
  • Subsystem: quic

What steps will reproduce the bug?

server.js

'use strict';

const fs = require('fs')

const key = fs.readFileSync('./key.pem');
const cert = fs.readFileSync('./cert.pem');

const { createQuicSocket } = require('net');

const toSend = Buffer.alloc(1024 * 64)

// Create the QUIC UDP IPv4 socket bound to local IP port 1234
const socket = createQuicSocket({ endpoint: { port: 1234 } });

socket.on('session', async (session) => {
    // A new server side session has been created!

    setInterval(async () => {

        console.log("new stream")
        const stream = await session.openStream()
        await stream.write(toSend)
        await stream.write(toSend)
        await stream.write(toSend)

        console.log("ending stream")
        stream.close()
    }, 100)

});

(async function () {
    await socket.listen({ key, cert, alpn: 'hello' });
    console.log('The socket is listening for sessions!');
})();

client.js

const { createQuicSocket } = require('net');
const net = require('net')
const debug = console.log

// Create a QuicSocket associated with localhost and port 1234
const socket = createQuicSocket({ endpoint: { port: 0 } });

const backendConnection = new net.Socket({ allowHalfOpen: true });
backendConnection.connect(80, '127.0.0.1', () => {
    (async function () {
        const client = await socket.connect({
            address: '127.0.0.1',
            port: 1234,
            alpn: 'hello'
        });

        client.on('secure', async () => {
            console.log('secure')
            client.on('stream', async (quicStream) => {
                console.log('stream')

                quicStream.on('end', function () {
                    console.log('early end')
                })

                quicStream.pipe(backendConnection, { end: false })


                quicStream.on('finish', () => {
                    debug("Completed sending response to tunnel client")

                    quicStream.unpipe(backendConnection)
                    quicStream.removeAllListeners()
                    quicStream.close()
                });

                // Handle quick stream errors
                quicStream.on('error', (err) => {
                    debug(`Quic Stream Error ${err}`)
                    quicStream.removeAllListeners()
                    quicStream.end()
                })

            })
        })
        // The QuicClientSession can now be used for application data
    })();
})

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

Usually within the first few iterations.

What is the expected behavior?

Script creates a stream, transfers data, closes.

What do you see instead?

node[5639]: ../src/quic/node_quic_stream-inl.h:29:void node::quic::QuicStream::set_final_size(uint64_t): Assertion `(final_size) <= (GetStat(&QuicStreamStats::final_size))' failed

Additional information

This is similar to an issue I reported against nodejs/quic that remain open.

@splitice splitice changed the title quic: quic: stats assertion on close Oct 31, 2020
@splitice
Copy link
Author

splitice commented Oct 31, 2020

Original issue nodejs/quic#383 responded to by @jasnell

Unlike last time where I did the testing on arm as well as x64 this time the entirety of the testing was on a loopback device of a x64 virtual machine running in docker.

@PoojaDurgad PoojaDurgad added the quic Issues and PRs related to the QUIC implementation / HTTP/3. label Dec 18, 2020
@jasnell
Copy link
Member

jasnell commented Feb 1, 2021

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

@jasnell jasnell closed this as completed Feb 1, 2021
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

3 participants