Hello community,

here is the log from the commit of package conmon for openSUSE:Factory checked 
in at 2020-03-19 19:45:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/conmon (Old)
 and      /work/SRC/openSUSE:Factory/.conmon.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "conmon"

Thu Mar 19 19:45:22 2020 rev:10 rq:785869 version:2.0.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/conmon/conmon.changes    2020-03-08 
22:24:01.532073320 +0100
+++ /work/SRC/openSUSE:Factory/.conmon.new.3160/conmon.changes  2020-03-19 
19:49:09.056144337 +0100
@@ -1,0 +2,6 @@
+Tue Mar 17 10:10:44 UTC 2020 - Ralf Haferkamp <rha...@suse.com>
+
+- Update to v2.0.12
+  - oom: fix potential race between verification steps
+
+-------------------------------------------------------------------

Old:
----
  conmon-2.0.11.tar.xz

New:
----
  conmon-2.0.12.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ conmon.spec ++++++
--- /var/tmp/diff_new_pack.rBRQrr/_old  2020-03-19 19:49:09.832144785 +0100
+++ /var/tmp/diff_new_pack.rBRQrr/_new  2020-03-19 19:49:09.836144788 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           conmon
-Version:        2.0.11
+Version:        2.0.12
 Release:        0
 Summary:        An OCI container runtime monitor
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.rBRQrr/_old  2020-03-19 19:49:09.912144831 +0100
+++ /var/tmp/diff_new_pack.rBRQrr/_new  2020-03-19 19:49:09.912144831 +0100
@@ -2,8 +2,8 @@
 <service name="tar_scm" mode="disabled">
 <param name="url">https://github.com/containers/conmon</param>
 <param name="scm">git</param>
-<param name="versionformat">2.0.11</param>
-<param name="revision">v2.0.11</param>
+<param name="versionformat">2.0.12</param>
+<param name="revision">v2.0.12</param>
 </service>
 <service name="recompress" mode="disabled">
 <param name="file">conmon-*.tar</param>

++++++ conmon-2.0.11.tar.xz -> conmon-2.0.12.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conmon-2.0.11/VERSION new/conmon-2.0.12/VERSION
--- old/conmon-2.0.11/VERSION   2020-03-04 19:07:40.000000000 +0100
+++ new/conmon-2.0.12/VERSION   2020-03-16 17:55:00.000000000 +0100
@@ -1 +1 @@
-2.0.11
+2.0.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conmon-2.0.11/src/conmon.c 
new/conmon-2.0.12/src/conmon.c
--- old/conmon-2.0.11/src/conmon.c      2020-03-04 19:07:40.000000000 +0100
+++ new/conmon-2.0.12/src/conmon.c      2020-03-16 17:55:00.000000000 +0100
@@ -541,6 +541,7 @@
        char *cgroup_event_control_path = (char *)user_data;
        uint64_t event_count;
        ssize_t num_read = 0;
+       gboolean cgroup_removed = FALSE;
 
        if ((condition & G_IO_IN) == 0) {
                /* End of input */
@@ -550,6 +551,20 @@
                return G_SOURCE_REMOVE;
        }
 
+       /* Attempt to read the container's cgroup path.
+        * if the cgroup.memory_control file does not exist,
+        * we know one of the events on this fd was a cgroup removal
+        */
+       if (access(cgroup_event_control_path, F_OK) < 0) {
+               ndebugf("Memory cgroup removal event received");
+               cgroup_removed = TRUE;
+       }
+
+       /* there are three cases we need to worry about:
+        * oom kill happened (1 event)
+        * cgroup was removed (1 event)
+        * oom kill happened and cgroup was removed (2 events)
+        */
        num_read = read(fd, &event_count, sizeof(uint64_t));
        if (num_read < 0) {
                nwarn("Failed to read oom event from eventfd");
@@ -570,23 +585,17 @@
 
        ndebugf("Memory cgroup event count: %ld", (long)event_count);
        if (event_count == 0) {
-               nwarn("Unexpected event count (zero)");
+               nwarn("Unexpected event count (zero) when reading for oom 
event");
                return G_SOURCE_CONTINUE;
        }
-       /* attempt to read the container's cgroup path.
-        * if we can't, the cgroup has probably been cleaned up.
-        * In all likelihood, this means we received an event on the eventfd
-        * because the memory.oom_control file was removed, not because of an 
OOM
+
+       /* if there's only one event, and the cgroup was removed
+        * we know the event was for a cgroup removal, not an OOM kill
         */
-       if (access(cgroup_event_control_path, F_OK) < 0) {
-               ndebugf("Memory cgroup removal event received");
-               /* if event_count == 1, we know the only event triggered was a 
cgroup removal
-                * if it was greater than 1, we know the cgroup oomed, and then 
was cleaned up.
-                */
-               if (event_count == 1)
-                       return G_SOURCE_CONTINUE;
-       }
+       if (event_count == 1 && cgroup_removed)
+               return G_SOURCE_CONTINUE;
 
+       /* we catch the two other cases here, both of which are OOM kill events 
*/
        ninfo("OOM event received");
        write_oom_files();
 


Reply via email to