holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.06k stars 85 forks source link

`network.discovery` is null in leave #30

Closed andrewosh closed 5 years ago

andrewosh commented 5 years ago

I just got this trace with calling close on a hyperswarm instance-- it might not be a bug inside hyperswarm, but some of the recent refactoring might be responsible.

/home/andrewosh/Development/megastore-swarm-networking/node_modules/hyperswarm/swarm.js:164
    const domain = network.discovery._domain(key)
                                     ^

TypeError: Cannot read property '_domain' of null
    at Swarm.leave (/home/andrewosh/Development/megastore-swarm-networking/node_modules/hyperswarm/swarm.js:164:38)
    at SwarmNetworker.unseed (/home/andrewosh/Development/megastore-swarm-networking/index.js:124:17)
    at Object.close (/home/andrewosh/Development/random-access-megastore/index.js:193:25)
    at defaultCore.ready.err (/home/andrewosh/Development/random-access-megastore/test/all.js:123:13)
    at /home/andrewosh/Development/random-access-megastore/node_modules/hypercore/index.js:206:15
    at apply (/home/andrewosh/Development/random-access-megastore/node_modules/thunky/index.js:44:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! Test failed.  See above for more details.
davidmarkclements commented 5 years ago

Looks like a bug - was close called before bind or was it called twice? If this.network is null it’s not been either not been initialised or its been destroyed. Obviously it’s still a bug and needs to be guarded

On Fri, 21 Jun 2019 at 18:23, Andrew Osheroff notifications@github.com wrote:

I just got this trace with calling close on a hyperswarm instance-- it might not be a bug inside hyperswarm, but some of the recent refactoring might be responsible.

/home/andrewosh/Development/megastore-swarm-networking/node_modules/hyperswarm/swarm.js:164 const domain = network.discovery._domain(key) ^

TypeError: Cannot read property '_domain' of null at Swarm.leave (/home/andrewosh/Development/megastore-swarm-networking/node_modules/hyperswarm/swarm.js:164:38) at SwarmNetworker.unseed (/home/andrewosh/Development/megastore-swarm-networking/index.js:124:17) at Object.close (/home/andrewosh/Development/random-access-megastore/index.js:193:25) at defaultCore.ready.err (/home/andrewosh/Development/random-access-megastore/test/all.js:123:13) at /home/andrewosh/Development/random-access-megastore/node_modules/hypercore/index.js:206:15 at apply (/home/andrewosh/Development/random-access-megastore/node_modules/thunky/index.js:44:12) at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! Test failed. See above for more details.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hyperswarm/hyperswarm/issues/30?email_source=notifications&email_token=AAJCWPAF4IRMI4TF5KL2OO3P3T6A5A5CNFSM4H2TDEFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3AABLQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJCWPFS2RWBC6OYMQNA2O3P3T6A5ANCNFSM4H2TDEFA .

mafintosh commented 5 years ago

This os fixed in my latest patch

pfrazee commented 5 years ago

dang you had to patch the whole os to fix this?

On Fri, Jun 21, 2019 at 5:30 PM Mathias Buus notifications@github.com wrote:

This os fixed in my latest patch

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hyperswarm/hyperswarm/issues/30?email_source=notifications&email_token=AAJWCUYYSAGNGR63TMZHIEDP3VJBXA5CNFSM4H2TDEFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJXU3I#issuecomment-504593005, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJWCU3Z372NNJ6SLU3YPS3P3VJBXANCNFSM4H2TDEFA .

mafintosh commented 5 years ago

Next time I’ll come switch your laptop!

pfrazee commented 5 years ago

oh dang that's some next level service for a protocol company