Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: connections closes after ~30 messages sent via lightpush #1790

Closed
fbarbu15 opened this issue Jan 15, 2024 · 7 comments
Closed

bug: connections closes after ~30 messages sent via lightpush #1790

fbarbu15 opened this issue Jan 15, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@fbarbu15
Copy link
Collaborator

This is a bug report

Steps

  1. Have jswaku and nwaku(or gowaku) connected via filter and lightpush protocols
  2. Subscribe jswaku to a topic
  3. Send 100 messages from jswaku via lightpush

Results

After ~30 messages the connections closes

  waku:error:stream-manager:/vac/waku/lightpush/2.0.0-beta1 Failed to prepare a new stream for 16Uiu2HAkvsoBeWj3NwGqZ4R1mmSQQzqmRwpCdmgYLmrMts7HZ9ne +0ms
  waku:error:stream-manager:/vac/waku/lightpush/2.0.0-beta1 Failed to prepare a new stream for 16Uiu2HAkvsoBeWj3NwGqZ4R1mmSQQzqmRwpCdmgYLmrMts7HZ9ne +0ms
  waku:error:light-push Failed to get a stream for remote peer16Uiu2HAkvsoBeWj3NwGqZ4R1mmSQQzqmRwpCdmgYLmrMts7HZ9ne CodeError: the connection is being closed
    at ConnectionImpl.newStream (file:///home/fbarbu15/WORK_DIR/js-waku/node_modules/libp2p/src/connection/index.ts:119:13)
    at StreamManager.newStream (file:///home/fbarbu15/WORK_DIR/js-waku/packages/core/src/lib/stream_manager.ts:54:23)
    at StreamManager.getStream (file:///home/fbarbu15/WORK_DIR/js-waku/packages/core/src/lib/stream_manager.ts:42:19)
    at async file:///home/fbarbu15/WORK_DIR/js-waku/packages/core/src/lib/light_push/index.ts:127:18
    at async Promise.allSettled (index 0)
    at async LightPush.send (file:///home/fbarbu15/WORK_DIR/js-waku/packages/core/src/lib/light_push/index.ts:179:21)
    at async Context.<anonymous> (file:///home/fbarbu15/WORK_DIR/js-waku/packages/tests/tests/filter/subscribe.node.spec.ts:174:13) {
  code: 'ERR_CONNECTION_BEING_CLOSED',
  props: {}

Attached test logs and nwaku docker log
js_waku_log.log
wakunode_Waku_Filter_V2_Subscribe_Subscribe_to_100_topics_at_once_and_receives_messages.log

  • js-waku version: master
  • Environment: node js
  • Nodes connected to too: nwaku or go-waku latest
@fbarbu15 fbarbu15 added the bug Something isn't working label Jan 15, 2024
@danisharora099
Copy link
Collaborator

danisharora099 commented Jan 17, 2024

Thanks for flagging this @fbarbu15, we'll investigate this on our end.

Can you share how you sent these messages? Were their send paralllelized, or were their awaited for per request? A reproducible minimal example could help

Thanks!

@fbarbu15
Copy link
Collaborator Author

This test reproduces the bug: https://github.com/waku-org/js-waku/pull/1791/files#diff-1c6dd30f4229c376d4619ed981a247180ae4c69a9582292dd03899196eac8b84R224
It's on this branch chore/max-sub-topic-count
They are awaited:

topicCount = 100
for (let i = 0; i < topicCount; i++) {
      await waku.lightPush.send(td.encoders[i], {
        payload: utf8ToBytes(`Message for Topic ${i + 1}`)
      });
    }

@danisharora099 danisharora099 self-assigned this Feb 15, 2024
@danisharora099
Copy link
Collaborator

@fbarbu15 this seems to be resolved with #1791
Is that correct?

Can we close this issue?

@fbarbu15
Copy link
Collaborator Author

fbarbu15 commented Feb 15, 2024

No, bug still reproduces, 1791 is unrelated

@danisharora099
Copy link
Collaborator

awaiting repsonse on waku-org/nwaku#2478

@danisharora099
Copy link
Collaborator

danisharora099 commented May 30, 2024

This seems to now be resolved with #2021

cc @fbarbu15

@fbarbu15
Copy link
Collaborator Author

This seems to now be resolved with #2021

cc @fbarbu15

Thanks, indeed it's fixed.
I've removed the try catch that this bug required in this PR #2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants