Yaniv Bronhaim has uploaded a new change for review.

Change subject: Using pidStat to get pid creation time
......................................................................

Using pidStat to get pid creation time

In proc/pid/stat field 21(starttime) defined the time when the process
started. Before we used ctime (time of last status change) that might change
during process run.

Change-Id: Ie8e056472e5c83104168e55a8dd01a941a2357f3
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=966133
Signed-off-by: Yaniv Bronhaim <[email protected]>
---
M vdsm/supervdsm.py
M vdsm/supervdsmServer.py
2 files changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/14998/1

diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 418242a..5e529be 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -27,7 +27,6 @@
 import uuid
 from errno import ENOENT, ESRCH
 
-import storage.misc as misc
 from vdsm import constants, utils
 
 _g_singletonSupervdsmInstance = None
@@ -168,7 +167,7 @@
                 raise
 
         try:
-            pTime = str(misc.getProcCtime(spid))
+            pTime = str(utils.pidStat(int(spid))[21])
         except OSError as e:
             if e.errno == ESRCH:
                 # Means pid is not exist, svdsm was killed
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index ce201e9..dada163 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -379,7 +379,7 @@
         with open(pidfile, "w") as f:
             f.write(str(spid) + "\n")
         with open(timestamp, "w") as f:
-            f.write(str(misc.getProcCtime(spid) + "\n"))
+            f.write(str(utils.pidStat(int(spid))[21]) + "\n")
 
         log.debug("Cleaning old socket %s", address)
         if os.path.exists(address):


--
To view, visit http://gerrit.ovirt.org/14998
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8e056472e5c83104168e55a8dd01a941a2357f3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to