Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Dat Close Assertion #217

Open
1 of 4 tasks
eu1444 opened this issue Aug 13, 2018 · 3 comments
Open
1 of 4 tasks

Dat Close Assertion #217

eu1444 opened this issue Aug 13, 2018 · 3 comments

Comments

@eu1444
Copy link

eu1444 commented Aug 13, 2018

I am reporting:

  • a bug or unexpected behavior
  • general feedback
  • feature request
  • security issue

Bug Report

  • Operating system: Debian GNU/Linux 9 (stretch) 64-bit
  • Node Version: v8.7.0
  • dat-node Version: 3.5.12

Expected behavior

I have some code that opens multiple Dats and then closes them all. The expected behavior is that all of the Dats open and then close without error.

https://gist.github.com/mistersdevelopment/2cddb3760e48de701e602933f3193a40

Actual behavior

The code intermittently asserts in libuv. I realize this may be a libuv issue but it could be how Dat is making use of libuv as well.

node: ../deps/uv/src/unix/udp.c:67: uv__udp_finish_close: Assertion `!uv__io_active(&handle->io_watcher, 0x001 | 0x004)' failed.

The assertion is here:
https://github.com/libuv/libuv/blob/619937c783a05b51fba95cc9a62543deeffe5fa7/src/unix/udp.c#L67

Debug Logs

node libuv-assert.js 
  dat-node archive ready. version: 0 +0ms
  dat-node archive ready. version: 0 +17ms
  dat-node archive ready. version: 0 +3ms
  dat-node Replication error: First shared hypercore must be the same +0ms
  dat-node Stream close +2ms
  dat-node Replication stream ended +5ms
  dat-node Replication error: First shared hypercore must be the same +680ms
  dat-node Stream close +1ms
  dat-node Replication stream ended +1ms
Created Dat "a9e3b0c7acef0417d2840c75ff38eb92b33effbe5843b65f7b7f9db6fcb70a71" with storage "dat-2"
Created Dat "5be8f49de14e6876374207e00260045b6c892cead878f735543bc90c2cc673ca" with storage "dat-0"
Created Dat "2b69b2062aee49b675880f821c5dc80b9f4a3b5adbda0d3f5e830dc1a45c3426" with storage "dat-1"
Destroying Dat "5be8f49de14e6876374207e00260045b6c892cead878f735543bc90c2cc673ca"
  dat-node leaveNetwork() +7s
Destroying Dat "2b69b2062aee49b675880f821c5dc80b9f4a3b5adbda0d3f5e830dc1a45c3426"
  dat-node leaveNetwork() +8ms
Destroying Dat "a9e3b0c7acef0417d2840c75ff38eb92b33effbe5843b65f7b7f9db6fcb70a71"
  dat-node leaveNetwork() +4ms
node: ../deps/uv/src/unix/udp.c:67: uv__udp_finish_close: Assertion `!uv__io_active(&handle->io_watcher, 0x001 | 0x004)' failed.

Thanks!

@JoshuaBrookover
Copy link

Also having this problem on OS X. Same node version.

@tullrich
Copy link

tullrich commented Aug 16, 2018

This gist appears to work on my Windows 10 machine with node version 8.7.0.

I tried it on Linux (4.17.6) Node version 8.0.0 and the gist again worked. However, if I increase the number of simultaneous archives it eventually fails with 8 open dats with the following error:

Created Dat "c70c9c0392915ddbad26301caca1c818af2915273d9d17e5f7875d58ff9e08fe" with storage "dat-1"
Created Dat "bfd6db5a09a6b6e2373b3f6e78a6505795e7a6f386356cb5d8f1a15287d665ce" with storage "dat-5"
Created Dat "4b0b40fc5d0be3c95196044a5f2e8e2d0468e93fce6d6538c0158493a5bb8e49" with storage "dat-4"
Created Dat "941cd1683df6023ea29dc4e9242aafa35cd8a014682699b06f744d5bef3aad25" with storage "dat-2"
Created Dat "f2c644bb6c223f4e9e8a5d88b1fded44259e0ffa03ad28d6dbdaad790516f56f" with storage "dat-6"
Created Dat "a83d642efcc4ddee6c3f97d3024dccbfe120a5dd6e7f91a517193847d964e7fb" with storage "dat-7"
Created Dat "ffc7258e515a58da7c949c61084554c892ad086388b9bc95f8052a18b9d9b9dd" with storage "dat-0"
Error: No nodes to query
    at RPC.queryAll (/projects/test/node_modules/k-rpc/index.js:123:27)
    at DHT.announce (/projects/test/node_modules/bittorrent-dht/client.js:423:13)
    at /projects/test/node_modules/bittorrent-dht/client.js:432:10
    at done (/projects/test/node_modules/bittorrent-dht/client.js:673:5)
    at done (/projects/test/node_modules/k-rpc/index.js:240:5)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)

Not sure if it is related.

@joehand
Copy link
Collaborator

joehand commented Aug 16, 2018

Thanks, we've seen similar issues but never been able to pin it down in the udp library. @mafintosh any ideas here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants