You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client closing sometimes leads to the following errors:
BadResource
error: (in promise) BadResource: Bad resource ID
nwritten += await w.write(arr.subarray(nwritten));
^
at async write (deno:ext/net/01_net.js:33:12)
at async writeAll (https://deno.land/[email protected]/streams/conversion.ts:422:17)
at async WireProtocol.send (https://deno.land/x/[email protected]/src/protocol/protocol.ts:101:7)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
Interrupted
error: (in promise) Interrupted: operation canceled
rr = await this.#rd.read(this.#buf);
^
at async read (deno:ext/net/01_net.js:28:19)
at async BufReader.read (https://deno.land/[email protected]/io/buffer.ts:383:12)
at async BufReader.readFull (https://deno.land/[email protected]/io/buffer.ts:415:20)
at async WireProtocol.receive (https://deno.land/x/[email protected]/src/protocol/protocol.ts:110:28)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
They are, most likely, caused by the fact that send and receive functions never catch anything and their calls (1, 2) don't use catch too.
I'm not quite familiar with this repo, but it looks like one could just catch these errors, which would, however, lead to the scenario when command queue is broken in case of real connection problem. That being said, it looks like this issue is somewhat related to automatic reconnect feature proposal – one should distinct errors occurred during mongoClient.close() calls (and catch them) and other errors (and try to reconnect, probably).
For anyone who want to make own tests less flaky on client close, I can suggest this workaround (one should use this before mongoClient.close()):
Client closing sometimes leads to the following errors:
They are, most likely, caused by the fact that send and receive functions never catch anything and their calls (1, 2) don't use
catch
too.I'm not quite familiar with this repo, but it looks like one could just catch these errors, which would, however, lead to the scenario when command queue is broken in case of real connection problem. That being said, it looks like this issue is somewhat related to automatic reconnect feature proposal – one should distinct errors occurred during
mongoClient.close()
calls (and catch them) and other errors (and try to reconnect, probably).For anyone who want to make own tests less flaky on client close, I can suggest this workaround (one should use this before
mongoClient.close()
):If anyone has better workaround, please write it in this thread.
The text was updated successfully, but these errors were encountered: