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

fix: updated closing dangling streams at src/transit.js #1307

Merged

Conversation

JS-AK
Copy link
Contributor

@JS-AK JS-AK commented Nov 7, 2024

added clean and close this.pendingResStreams when node disconnected

📝 Description

Fixed memory leak when another microservice started stream with broker.call and then switched off (with reboot for example)

Create 3 services, api-gw, test-1, test-2
api-gw handle request -> test-1
test-1 make stream and send it to test-2
test-2 send answer stream to test-1
test-1 send stream to api-gw
terminate test-2 process

If microservice test-2 was terminated (in active stream process) in api-gw service src/transit.js this.pendingResStreams and this.pendingRequests was not released/deleted

💎 Type of change

  • Bug fix (non-breaking change which fixes an issue)

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

It is for close issue
#1296

Repo for reproduce this bug

https://github.com/JS-AK/moleculer-pr-1307-example

Copy link

pkg-pr-new bot commented Nov 7, 2024

Open in Stackblitz

npm i https://pkg.pr.new/moleculerjs/moleculer@1307

commit: c197d5c

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@icebob icebob merged commit 7683348 into moleculerjs:master Nov 14, 2024
179 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants