fetch()
rejection intermittently causes Deno to panic in threadsafe_functions.rs:113
#20279
Labels
fetch()
rejection intermittently causes Deno to panic in threadsafe_functions.rs:113
#20279
Credits to @eseiker who first discovered the issue and @Akamig who originally wrote this report.
Code causing the panic: https://github.com/planetarium/Corvette/blob/0.1.0/emitter.ts#L286-L305
When
fetch()
promise rejects, deno intermittently panicks, and it seems to do so while trying to unwrap the error-causing callback at threadsafe_functions.ts.While bashing at this issue we found some other cases of
Result::unwrap()
causing Deno panic, so we think there's a possibility that the problem might be rooted deeper than thedeno_fetch
implementation.What we tried to see if it roots somewhere in the code, and didn't help:
catch
, but that didn't work..then()
and.catch(() => {})
(verbatim), completely ignoring the exception, which didn't help as well.await [...].map().reduce((promiseAcc, promise) => {const acc = await promiseAcc, x = await promise; return [...promiseAcc, x]})
instead ofawait Promise.all([...])
in attempt to serialize the processing, but no chance.Possibly related and referenced issues:
Unknown TLS backend passed to "use_preconfigured_tls"
#19177dead_socket_tx
Causes Unit Test Regressions to Fail microsoft/demikernel#246A few more questions on trying to solve the problem we're experiencing: we're a bit short on the understanding of what
threadsafe_functions.ts
does, so it would be of great help understanding the issue if anyone (possibly the authors of this code: @littledivy, @bartlomieju, @DjDeveloperr, @ry) could explain to us what is happening in the lines here:deno/cli/napi/threadsafe_functions.rs
Lines 109 to 113 in f9beb92
[inetstack]
dead_socket_tx
Causes Unit Test Regressions to Fail microsoft/demikernel#246 points out on a similar unbound Sender-Reciever structure thatunbound_send
will fail and cause panic if the receiver is disconnected beforeunbound_send
is executed. If this is true, why should L113 never fail, despite as commented in L109, Receiver might already have been dropped?Shouldn't unbound_send(call) be awaited first before being unwrapped?
If
threadsafe_functions.ts
is not the culprit, what could possibly be causing this issue? As far as we know, our code surrounding thefetch()
call is not anything extraordinary.The text was updated successfully, but these errors were encountered: