Skip to content

Conversation

@raytung
Copy link
Member

@raytung raytung commented Mar 3, 2022

Fixes #33.

@raytung raytung force-pushed the fix/connect-crash branch from d20b86c to 973ffc4 Compare March 3, 2022 23:33
…ling `emit()`, `disconnect()` and `connect()` in quick succession

Signed-off-by: Ray Tung <ray@kasada.io>
@raytung raytung force-pushed the fix/connect-crash branch from 973ffc4 to 6f84b6b Compare March 3, 2022 23:46
Copy link
Collaborator

@jamiees2 jamiees2 left a comment

Choose a reason for hiding this comment

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

Hey! sorry about getting such a late start on this :( I was going to try to get this in before my vacation, but was unable to, and didn't really have internet while I was on vacation :)

Anyway, this LGTM, thanks for fixing! I'm going to work on #32 during the weekend, and then once I get that done, I'll cut a new release, if that's OK with you :) Let me know if you want a release for this sooner and I can push it out

await awaitNextTick();
await new Promise(resolve =>
this.once(FluentSocketEvent.CLOSE, resolve)
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

huh, I wonder why I didn't just do this in the first place 🤷 I guess I read somewhere in the node docs that it will be disconnected by the next tick? not sure where I got that from.

@jamiees2 jamiees2 merged commit 8387aa0 into fluent:master Mar 11, 2022
github-actions bot added a commit that referenced this pull request Mar 11, 2022
…en calling `emit()`, `disconnect()` and `connect()` in quick succession (#34)

Signed-off-by: Ray Tung <ray@kasada.io> 8387aa0
@raytung raytung deleted the fix/connect-crash branch March 13, 2022 22:31
@raytung
Copy link
Member Author

raytung commented Mar 13, 2022

@jamiees2 No worries, it's important to take breaks and have holidays 😄 Thanks for taking a look at this.

github-actions bot added a commit to raytung/fluent-logger-forward-node that referenced this pull request Mar 13, 2022
…en calling `emit()`, `disconnect()` and `connect()` in quick succession (fluent#34)

Signed-off-by: Ray Tung <ray@kasada.io> 8387aa0
@jamiees2
Copy link
Collaborator

Released in v1.0.8 :)

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.

NodeJS heap out of memory caused by multiple connects and disconnects

2 participants