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

doc: add a note about os.cpus() returning an empty list #47363

Merged
merged 1 commit into from Apr 4, 2023

Conversation

codedokode
Copy link
Contributor

It is not obvious that in some cases cpus() returns an empty list and this has caused a bug before: isaacs/promise-call-limit#11

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. os Issues and PRs related to the os subsystem. labels Apr 1, 2023
doc/api/os.md Outdated Show resolved Hide resolved
@bnoordhuis
Copy link
Member

Rather than going into platform-specific details, I'd change this line:

Returns an array of objects containing information about each logical CPU core.

And append something like:

The array can be empty if no CPU information is available.

Node gets its data from libuv and libuv doesn't document it reads from /proc so it'd be odd to mention that in our docs.

OTOH, mentioning /proc does give readers a hint to mount procfs. (On the other other hand, that's unlikely to be actionable on Android.) Let's say I'm -0 on the current wording.

doc/api/os.md Outdated Show resolved Hide resolved
@Trott
Copy link
Member

Trott commented Apr 3, 2023

Rather than going into platform-specific details, I'd change this line:

Returns an array of objects containing information about each logical CPU core.

And append something like:

The array can be empty if no CPU information is available.

Node gets its data from libuv and libuv doesn't document it reads from /proc so it'd be odd to mention that in our docs.

OTOH, mentioning /proc does give readers a hint to mount procfs. (On the other other hand, that's unlikely to be actionable on Android.) Let's say I'm -0 on the current wording.

@bnoordhuis I've reworked this along the lines of your suggest. PTAL.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

"file system" but otherwise LGTM :)

doc/api/os.md Outdated Show resolved Hide resolved
@Trott Trott added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 4, 2023
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 4, 2023
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/47363
✔  Done loading data for nodejs/node/pull/47363
----------------------------------- PR info ------------------------------------
Title      doc: add a note about os.cpus() returning an empty list (#47363)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     codedokode:codedokode-patch-1 -> nodejs:main
Labels     doc, os, commit-queue-squash
Commits    2
 - doc: add a note about os.cpus() returning an empty list
 - Update doc/api/os.md
Committers 2
 - Rich Trott 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/47363
Reviewed-By: Ben Noordhuis 
Reviewed-By: Rich Trott 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/47363
Reviewed-By: Ben Noordhuis 
Reviewed-By: Rich Trott 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sat, 01 Apr 2023 12:39:35 GMT
   ✔  Approvals: 2
   ✔  - Ben Noordhuis (@bnoordhuis) (TSC): https://github.com/nodejs/node/pull/47363#pullrequestreview-1370467845
   ✔  - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/47363#pullrequestreview-1371525436
   ✔  Last GitHub CI successful
   ℹ  Green GitHub CI is sufficient
   ⚠  PR author is a new contributor: @codedokode(codedokode@gmail.com)
   ⚠  - commit 05afb4639190 is authored by info@bnoordhuis.nl
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/4610991181

Trott pushed a commit to codedokode/node that referenced this pull request Apr 4, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: nodejs#47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: nodejs#47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott Trott merged commit dfbad86 into nodejs:main Apr 4, 2023
4 checks passed
@Trott
Copy link
Member

Trott commented Apr 4, 2023

Landed in dfbad86

@Trott
Copy link
Member

Trott commented Apr 4, 2023

Thanks for the contribution! 🚀

RafaelGSS pushed a commit that referenced this pull request Apr 5, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 5, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Apr 6, 2023
RafaelGSS pushed a commit that referenced this pull request Apr 6, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 7, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 8, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 13, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: #47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
It is not obvious that in some cases cpus() returns an empty list and
this has caused a bug before:
isaacs/promise-call-limit#11

PR-URL: nodejs#47363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-failed An error occurred while landing this pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants