From b9ffb82f9b278c801556b96efece98b88d796077 Mon Sep 17 00:00:00 2001 From: Nicholas Schamberg Date: Mon, 14 Dec 2020 01:57:15 +0300 Subject: [PATCH] doc: os.uptime() temporary bug notice Makes it clear that os.uptime() is unreliable in some virtualization cases. PR-URL: https://github.com/nodejs/node/pull/36503 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Gireesh Punathil Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell --- doc/api/os.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/os.md b/doc/api/os.md index 6c184a77854b1e..378a85771d6056 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -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 and + for an exploration of +this issue, until it is resolved by libuv. + ## `os.userInfo([options])`