Content-Length: 255919 | pFad | http://github.com/nodejs/node/pull/57119

51 test: add quic datagrams test by achingbrain · Pull Request #57119 · nodejs/node · GitHub
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

test: add quic datagrams test #57119

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

achingbrain
Copy link

Adds tests for sending and receiving datagrams as strings and buffers from client->server and server->client.

Switches offset/length around in Uint8Array constructor call as otherwise we send empty datagrams which get ignored.

The test currently fails because the first datagram is received many times.

Adds tests for sending and receiving datagrams as strings and
buffers from client->server and server->client.

Switches offset/length around in `Uint8Array` constructor call
as otherwise we send empty datagrams which get ignored.

The test currently fails because the first datagram is received
many times.
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Feb 18, 2025
@achingbrain
Copy link
Author

Opened as a draft because the tests don't pass currently.

@achingbrain
Copy link
Author

@jasnell I found a bit of weirdness in the implementation.

It's mentioned in the test comments but if you call sendDatagram too soon after staring the session, this check returns false so the datagram is not sent.

I would have thought that datagrams would be sendable after the opened promise on the session resolves but it appears not.

After waiting for an arbitrary period the datagram is sent but is received multiple times. Is the user supposed to filter these duplicates out or is it an implementation bug?

Finally if you close the server listener without first closing any active sessions a segfault occurs. If you do close the sessions first, the promise returned from the listener .close() method resolves, but the process keeps running.

The segfault stack trace is:

----- Native stack trace -----

 1: 0x10456cf44 node::DumpNativeBacktrace(__sFILE*) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 2: 0x1046dbf98 node::Assert(node::AssertionInfo const&) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 3: 0x104aa6048 node::quic::Endpoint::local_address() const [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 4: 0x104aaa1e4 node::quic::Endpoint::Receive(uv_buf_t const&, node::SocketAddress const&) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 5: 0x104aa2964 node::quic::Endpoint::UDP::Impl::OnReceive(uv_udp_s*, long, uv_buf_t const*, sockaddr const*, unsigned int) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 6: 0x1063f1660 uv__udp_recvmsg [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 7: 0x1063efe74 uv__udp_io [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 8: 0x1063f6a6c uv__io_poll [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
 9: 0x1063d1fe8 uv_run [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
10: 0x10449d100 node::SpinEventLoopInternal(node::Environment*) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
11: 0x104765288 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
12: 0x104764ef0 node::NodeMainInstance::Run() [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
13: 0x104639830 node::StartInternal(int, char**) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
14: 0x10463944c node::Start(int, char**) [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
15: 0x1069fa1c4 main [/Users/alex/Documents/Workspaces/achingbrain/node/out/Debug/node]
16: 0x1827d0274 start [/usr/lib/dyld]
FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope

..so it looks like maybe the client is still sending the duplicate datagrams to the server even after the session has been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nodejs/node/pull/57119

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy