Skip to content

Commit

Permalink
doc: os.uptime() temporary bug notice
Browse files Browse the repository at this point in the history
Makes it clear that os.uptime() is unreliable in some virtualization
cases.

PR-URL: #36503
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
schamberg97 authored and danielleadams committed Jan 12, 2021
1 parent da49624 commit 3b64b38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,18 @@ changes:

Returns the system uptime in number of seconds.

The value returned can be inaccurate in some
rare virtualization cases. The issue arises when the virtualized
guest instance shares the kernel with the host system.
Due to the fact that libuv uses a syscall that
provides host's uptime instead of guest's
uptime on OpenVZ, `os.uptime()` may also provide
erroneous result.

Please refer to <https://github.com/nodejs/node/issues/36244> and
<https://github.com/libuv/libuv/issues/3068> for an exploration of
this issue, until it is resolved by libuv.

## `os.userInfo([options])`
<!-- YAML
added: v6.0.0
Expand Down

0 comments on commit 3b64b38

Please sign in to comment.