Skip to content

Commit 3b64b38

Browse files
schamberg97danielleadams
authored andcommitted
doc: os.uptime() temporary bug notice
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]>
1 parent da49624 commit 3b64b38

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/api/os.md

+12
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,18 @@ changes:
368368

369369
Returns the system uptime in number of seconds.
370370

371+
The value returned can be inaccurate in some
372+
rare virtualization cases. The issue arises when the virtualized
373+
guest instance shares the kernel with the host system.
374+
Due to the fact that libuv uses a syscall that
375+
provides host's uptime instead of guest's
376+
uptime on OpenVZ, `os.uptime()` may also provide
377+
erroneous result.
378+
379+
Please refer to <https://github.com/nodejs/node/issues/36244> and
380+
<https://github.com/libuv/libuv/issues/3068> for an exploration of
381+
this issue, until it is resolved by libuv.
382+
371383
## `os.userInfo([options])`
372384
<!-- YAML
373385
added: v6.0.0

0 commit comments

Comments
 (0)