ChainSafe / js-libp2p-yamux

Typescript implementation of Yamux
Other
10 stars 8 forks source link

Yamux causing problems in production Elastic IPFS deployment #23

Closed alanshaw closed 1 year ago

alanshaw commented 1 year ago

We had to revert adding yamux to Elastic IPFS. I need to verify the exact cause and will add the error here - we think the node process is crashing but have not been able to retrieve logs just yet.

Here's our graphs showing recovery after revert:

Screenshot 2023-02-28 at 14 22 11
alanshaw commented 1 year ago

Might be this unhandled rejection...:

[ERR_STREAM_ABORT] stream aborted
CodeError: stream aborted
    at EventTarget.abort (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:190:20)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:731:20)
    at EventTarget.dispatchEvent (node:internal/event_target:673:26)
    at abortSignal (node:internal/abort_controller:308:10)
    at AbortController.abort (node:internal/abort_controller:338:5)
    at YamuxStream.closeWrite (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:126:30)
    at YamuxStream.close (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:97:14)
    at file:///app/node_modules/libp2p/dist/src/connection/index.js:80:41
    at Array.forEach (<anonymous>)
    at ConnectionImpl.close (file:///app/node_modules/libp2p/dist/src/connection/index.js:80:26)

EDIT: yes it is - it's being caught here https://github.com/elastic-ipfs/bitswap-peer/blob/8fa6d8ec9c7b588a2cf0319bee2b1b9acec443c6/src/index.js#L71-L73

Original log line:

{
  "level":60,
  "time":"2023-03-01T15:42:57.420Z",
  "v":"0.17.0",
  "err":"[ERR_STREAM_ABORT] stream aborted\nCodeError: stream aborted\n    at EventTarget.abort (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:190:20)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:731:20)\n    at EventTarget.dispatchEvent (node:internal/event_target:673:26)\n    at abortSignal (node:internal/abort_controller:308:10)\n    at AbortController.abort (node:internal/abort_controller:338:5)\n    at YamuxStream.closeWrite (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:126:30)\n    at YamuxStream.close (file:///app/node_modules/@chainsafe/libp2p-yamux/dist/src/stream.js:97:14)\n    at file:///app/node_modules/libp2p/dist/src/connection/index.js:80:41\n    at Array.forEach (<anonymous>)\n    at ConnectionImpl.close (file:///app/node_modules/libp2p/dist/src/connection/index.js:80:26)",
  "promise":{},
  "msg":"unhandled rejection"
}
wemeetagain commented 1 year ago

Thanks for reporting. Seems the issue is this Promise rejection not being handled: https://github.com/ChainSafe/js-libp2p-yamux/blob/master/src/stream.ts#L289 Working on a fix now

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.0.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: