FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

diagnostics_channel: fix ref counting bug when reaching zero subscribers by Qard · Pull Request #47520 · nodejs/node · GitHub

/ node Public

diagnostics_channel: fix ref counting bug when reaching zero subscribers - #47520

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Qard:fix-diagnostics-channel-ref-counting
Apr 13, 2023
Merged

diagnostics_channel: fix ref counting bug when reaching zero subscribers#47520
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Qard:fix-diagnostics-channel-ref-counting

Conversation

Qard commented Apr 12, 2023

Copy link
Copy Markdown
Member

I discovered a bug in some of the changes I landed with TracingChannel. Technically the bug existed before, but we've been discouraging use of channel.subscribe(...) and channel.unsubscribe(...). With the TracingChannel changes I included a fix for the GC issue that allows channel.subscribe(...) and channel.unsubscribe(...) to work as they were originally intended, and some simplifications were made to make the top-level functions delegate to those. Unfortunately, there was an unnoticed issue where if the subscriber count ever dropped to zero the weakref would be deleted from the channels map but channel objects could still be held and therefore could still have subscribers added which would attempt an incRef on a weakref that's not there anymore. To handle that safely the delete actually has to happen only when there are no more strong refs, meaning when GC happens, so I've changed it to use FinalizationRegistry instead.

Qard added confirmed-bug Issues with confirmed bugs. diagnostics_channel Issues and PRs related to diagnostics channel labels Apr 12, 2023
nodejs-github-bot added the needs-ci PRs that need a full CI run. label Apr 12, 2023

simon-id left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lint issues otherwise LGTM

Qard commented Apr 12, 2023

Copy link
Copy Markdown
Member Author

Yep, I'll fix those in the morning. My editor always seems to want to inject those spaces where they shouldn't be. 🙈

Comment thread lib/diagnostics_channel.js Outdated
Qard force-pushed the fix-diagnostics-channel-ref-counting branch from b749f53 to 2fcddb3 Compare April 12, 2023 16:13
Qard added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 12, 2023

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @Qard. Please 👍 to approve.

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023

This comment was marked as outdated.

ronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

RSLGTM

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023

This comment was marked as outdated.

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023

This comment was marked as outdated.

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023

Copy link
Copy Markdown
Collaborator

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2023
Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023

This comment was marked as outdated.

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023

This comment was marked as outdated.

This comment was marked as outdated.

Qard added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

RafaelGSS added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2023
nodejs-github-bot merged commit 6fb74c7 into nodejs:main Apr 13, 2023

Copy link
Copy Markdown
Collaborator

Landed in 6fb74c7

Qard deleted the fix-diagnostics-channel-ref-counting branch April 13, 2023 18:49
RafaelGSS pushed a commit that referenced this pull request Apr 13, 2023
PR-URL: #47520
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
targos pushed a commit that referenced this pull request Nov 10, 2023
PR-URL: #47520
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#47520
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#47520
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confirmed-bug Issues with confirmed bugs. diagnostics_channel Issues and PRs related to diagnostics channel fast-track PRs that do not need to wait for 48 hours to land. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL