Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25799

XWiki installed with the xjetty Debian package is not restarted after the kernel's OOM killer kills it

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.9.0
    • Distribution - Debian
    • None
    • Unknown

    Description

      xwiki.service, from xwiki-xjetty-common, has Restart=on-abort.

      On a host with cgroup v2, when the kernel's OOM killer kills the JVM, systemd ends the unit with the result oom-kill. Restart=on-abort only covers a process killed by an uncaught signal, so the unit stays failed and XWiki stays down until someone starts it.

      On cgroup v1 systemd only sees a process killed by a signal, and the same unit is restarted. So the behaviour changed with the move of distributions to cgroup v2.

      Steps to reproduce

      1. Install xwiki-xjetty-pgsql 18.9.0 on Debian 13 (cgroup v2, systemd 257).
      2. Limit the memory of the unit below what the JVM may use: a drop-in with MemoryMax=1200M, MemorySwapMax=0 and JDK_JAVA_OPTIONS=-Xmx4g, then restart.
      3. Make XWiki use more memory than the limit.

      Result

      kernel: oom-kill:constraint=CONSTRAINT_MEMCG,...,task_memcg=/system.slice/xwiki.service,task=java
      systemd[1]: xwiki.service: A process of this unit has been killed by the OOM killer.
      systemd[1]: xwiki.service: Failed with result 'oom-kill'.
      

      systemctl show xwiki.service then gives ActiveState=failed, Result=oom-kill, NRestarts=0.

      Expected

      XWiki is started again, as it is after a crash. Restart=on-failure covers this case.

      Seen also on Debian 12 (systemd 252) and Ubuntu 26.04 (systemd 259). Debian's own tomcat10 and tomcat11 units have the same Restart=on-abort, so the Tomcat packages behave the same; that unit is not XWiki's.

      Attachments

        Activity

          People

            ciaens Clément Christiaens
            ciaens Clément Christiaens
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: