Bug 1032705
Summary: | libvirt_lxc consumes 100% cpu when console client is disconnected and guest writes data | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Daniel Berrangé <berrange> |
Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | acathrow, ajia, dyuan, lsu, mzhan, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.1.1-14.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | 1005570 | Environment: | |
Last Closed: | 2014-06-13 10:31:57 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Daniel Berrangé
2013-11-20 15:40:27 UTC
Fixed upstream by commit 5087a5a0092853702eb5e0c0297937a7859bcab3 Author: Daniel P. Berrange <berrange> Date: Fri Nov 1 16:24:30 2013 +0000 Fix busy wait loop in LXC container I/O handling Reproduce it with libvirt-1.1.1-13.el7.x86_64 1.Start a lxc named test #virsh -c lxc:/// start test enter test , leave #while true ; do echo "a" >> test.txt ; done then exit from it. On host #top 8932 root 20 0 11736 1696 1344 R 99.8/*almost 100%*/ 0.0 5:35.46 sh #pstree -alp -libvirt_lxc,8928 --name test --console 22 --security=selinux --handshake 26 --background --veth vnet1 | |-sh,8932 | `-{libvirt_lxc},8931 2.After restart it , everything back to normally I made a mistake in comment 4 , fixed and verified here with libvirt-1.1.1-16.el7.x86_64 1.Prepare a lxc container <domain type='lxc'> <name>test</name> <uuid>318c2db7-6dad-4f31-b217-ecad21524713</uuid> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64'>exe</type> <init>/bin/sh</init> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/libvirt_lxc</emulator> <interface type='network'> <mac address='00:16:3e:4e:4c:62'/> <source network='default'/> </interface> <console type='pty'> <target type='lxc' port='0'/> </console> </devices> </domain> #virsh -c lxc:/// define test.xml #virsh -c lxc:/// start test 2.Find which console the container using then login #virsh -c lxc:/// dumpxml test ... <console type='pty' tty='/dev/pts/1'> <source path='/dev/pts/1'/> <target type='lxc' port='0'/> .... #virsh -c lxc:/// console test In container sh-4.2#while true ; do echo fill > /dev/pts/0 ; sleep 0.01 ; done Note:Make sure the command will not lead to a normal hosts cpu taking up 100% Then close the terminal to leave the sh loop run in container itself 3. #top Watch the ps libvirt_lxc's %cpu In libvirt-1.1.1-13 , it will grow up to 100% after few minutes . In libvirt-1.1.1-14 and those versions later , the cpu% will keep a normal value which as same as whose run in the host , and after awhile , it will down to 0 , except login it again. 4. You can open the debug level log , find something like cont closed = 0 , host closed != 0 , that's the key to trigger the issue According above , set VERIFIED This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |