denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.78k stars 5.38k forks source link

error: Uncaught "Missing promise in ring @ 2145893703" #22759

Open GirkovArpa opened 8 months ago

GirkovArpa commented 8 months ago
error: Uncaught "Missing promise in ring @ 2145893703"
deno --version
deno 1.41.1 (release, x86_64-pc-windows-msvc)
v8 12.1.285.27
typescript 5.3.3

What does this error even mean? For example, what is a "ring", and what does that number refer to? It seems too large to be a line number.

mmastrac commented 8 months ago

Thanks for the report.

Was this in a long-running server process? Could you describe what the server does and which APIs it uses?

GirkovArpa commented 8 months ago

It's a long-running websocket server:

Deno.serve(async req => {
    if (req.headers.get('upgrade') != 'websocket') {
        return new Response(null, { status: 501 });
    }

    const { socket, response } = Deno.upgradeWebSocket(req);

It uses this function a lot, inside a computationally-intensive function:

function pause(ms) {
    return new Promise(resolve => setTimeout(resolve, ms || 0));
}

But I've been experimenting with it for weeks, and left it running for hours, without any problems. Until today, it randomly crashed with this error, without me updating the code.