oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.09k stars 2.67k forks source link

Panic on http call to Artifactory #11229

Open tram98 opened 3 months ago

tram98 commented 3 months ago

How can we reproduce the crash?

Disclamier: the code is company internal, so I cannot share details, so sorry :(

This error happes on occasion using the fetch function of the node-fetch module v.3.3.2 Entry in package.json: "node-fetch": "^3.3.2",

I cannot reproduce it reliably, sometimes it works, sometimes it crashes.

JavaScript/TypeScript code that reproduces the crash?

async function sendRequestToArtifactory(url: string, body: string | null, method: string) {
    return await fetch(url, {
        headers: {
            authorization: `Basic ${b64Encode(`${ARTIFACTORY_USER}:${ARTIFACTORY_PASSWORD}`)}`,
            accept: "application/json, text/plain, */*",
            "content-type": "application/json;charset=UTF-8",
        },
        body: body,
        method: method,
    });
}

Relevant log output

Bun v1.1.8 (89d25807) Windows x64
Args: "C:\Users\<REDACTED>\.bun\bin\bun.exe", "run", "src/local-environment/<REDACTED>/main.ts", "<REDACTED>"
Features: jsc Bun.stdin(2) Bun.stdout fetch(2) spawn(2) transpiler_cache tsconfig(3) 
Builtins: "bun:main" "node:buffer" "node:child_process" "node:events" "node:fs" "node:os" "node:path" "node:process" "node:stream" "node:string_decoder" "node:tty" "node:util" "node:util/types" "node-fetch" 
Elapsed: 40114ms | User: 343ms | Sys: 156ms
RSS: 0.23GB | Peak: 0.23GB | Commit: 0.25GB | Faults: 59881

panic(thread 64232): Internal assertion failure
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Stack Trace (bun.report)

Bun v1.1.8 (89d2580) on windows x86_64 [RunCommand]

panic: Internal assertion failure

Jarred-Sumner commented 3 months ago

This would happen if Worker objects were being closed while a fetch() is in progress

tram98 commented 3 months ago

@Jarred-Sumner Do you need further help from my side?

github-actions[bot] commented 1 month ago

This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment.