ChainSafe / js-libp2p-yamux

Typescript implementation of Yamux
Other
10 stars 8 forks source link

fix: silence max listeners exceeded warning #62

Closed achingbrain closed 7 months ago

achingbrain commented 7 months ago

If we have more than 10x streams open accross all yamux muxer instances node will log warnings about too many listeners being added to the shutdown controller signal.

This is fine, increase the max number of listeners.

Also, where we create an abort signal for the close call, clone the options object instead of adding our signal to it, it's pretty common for people to pass an options object to several calls, this way we don't accidentally add a signal to an onwards method invocation 😬 .

codecov-commenter commented 7 months ago

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/encode.ts 100.00% <100.00%> (ø)
test/codec.spec.ts 100.00% <100.00%> (ø)
test/compliance.spec.ts 100.00% <100.00%> (ø)
test/decode.spec.ts 96.01% <100.00%> (-0.02%) :arrow_down:
test/muxer.spec.ts 100.00% <100.00%> (ø)
test/stream.spec.ts 100.00% <100.00%> (+0.90%) :arrow_up:
test/util.ts 100.00% <100.00%> (ø)
src/decode.ts 93.75% <88.88%> (-1.39%) :arrow_down:
src/stream.ts 98.01% <99.08%> (+2.52%) :arrow_up:
test/codec.util.ts 94.28% <66.66%> (ø)
... and 2 more

:loudspeaker: Thoughts on this report? Let us know!

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 5.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: