Open eseiker opened 1 year ago
So I scanned other code bases reporting similar issue,
First I can safely conclude two of each bugs are seperated issue.
About the first one, "thread '<unnamed>' panicked at 'called
Result::unwrap()on an
Errvalue: TrySendError { kind: Disconnected }'
,
In this instance, if we look at that line of threadsafe_functions.rs, that line is ominously commented as "this call should not fail", which actually failed in our case.
There was a long babble about what unbound_send() even means, but simply put it's the process of inter-thread communication, and as it try to 'unwrap' the 'unbounded_send(call)',
As far as I deduct, it expects "Err" and unwrap the actual error, but because of unsafe call_js_cb, which calls callback as it's name, possibly callback function being async function, and since await is not used before unwrap that thing, so it panics while try to unwrap some asynchronous function call instead of bubbling up it's error.
On contrary, since this caused while handling result of unbound_send(), which is inter-thread operation, so call stack couldn't be properly given because of, y'know, multi-threaded execution flow thingy.
In short, it seems bug in Deno as that log says. Damn.
Possibly Relevant Issues: https://github.com/denoland/deno/issues/5334 https://github.com/paritytech/jsonrpsee/issues/284 https://github.com/microsoft/demikernel/issues/246
As the error message states, the unbound_send always fails because the receiver is disconnected. So we always panic here. As you can see the receiver is immediately dropped. So I don't see how this code is every supposed to not fail. Or what is the point of it since it doesn't seem to do anything?
And I personally think this is very crucial observation. It even also commented in threadsafe_functions.rs this reciever might have already dropped. So I guess this panic happends when reciever dropped before unbound_send able to do anything.
Anyway, sadly this is barely comprehensible for me, I have no single idea to mitigate this issue.
At least we know it happens when we tries to unwrap the content of fetch error, can we just ignore error temporarily and prevent that thing from getting executed?
Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.), transient: false }) at Rn.handleRequestError (file:///Users/mizuki/Projects/Corvette/generated/client/runtime/library.js:174:7499) at Rn.handleAndLogRequestError (file:///Users/mizuki/Projects/Corvette/generated/client/runtime/library.js:174:6754) at Rn.request (file:///Users/mizuki/Projects/Corvette/generated/client/runtime/library.js:174:6344) at async file:///Users/mizuki/Projects/Corvette/emitter.ts:310:13 at async Promise.all (index 0) at async file:///Users/mizuki/Projects/Corvette/emitter.ts:265:22 at async doMutex (file:///Users/mizuki/Projects/Corvette/concurrencyUtils.ts:19:16) at async emitEvents (file:///Users/mizuki/Projects/Corvette/emitter.ts:262:7)