Red Hat Bugzilla – Bug 1357776
Service is not re-enabled when increasing max_clients limit after it has been reached.
Last modified: 2016-11-03 14:50:32 EDT
Description of problem: When max_clients limit has been reached, increase max_clients by "srv-clients-set --max-clients" at run time, then try to connect new virsh client to libvirtd, but it failed. Version-Release number of selected component (if applicable): libvirt-2.0.0-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Set max_clients limit in libvirtd.conf max_clients = 2 max_anonymous_clients = 2 2. Restart libvirtd sevice 3. # virt-admin srv-clients-info libvirtd nclients_max : 2 nclients : 0 nclients_unauth_max : 2 nclients_unauth : 0 4.Open two terminals, connect a virsh client in each terminal: # virsh -c qemu:///system 5. # virt-admin srv-clients-info libvirtd nclients_max : 2 nclients : 2 nclients_unauth_max : 2 nclients_unauth : 0 6. Increase max_clients limit: # virt-admin srv-clients-set libvirtd --max-clients 5 # virt-admin srv-clients-info libvirtd nclients_max : 5 nclients : 2 nclients_unauth_max : 5 nclients_unauth : 0 7.Connect a new virsh client to libvirtd: # virsh -c qemu:///system (hangs) 8.Quit an existing virsh client which is connected in step 4: virsh # quit 9. Check the virsh client in step7, it's connected successfully # virsh -c qemu:///system Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # Actual results: In step 7, virsh client didn't connect to libvirtd successfully. Expected results: New virsh client can connect to libvirtd successfully after increasing max_clients limit at run time.
Fixed upstream by: commit e9ce8a7d24a94f0be19705ae0e63aaa054c39e88 Author: Erik Skultety <eskultet@redhat.com> AuthorDate: Wed Jul 20 12:10:29 2016 +0200 Commit: Erik Skultety <eskultet@redhat.com> CommitDate: Tue Aug 2 14:51:13 2016 +0200 admin: rpc: virnetserver: Fix updating of the client limits Commit 2737aaaf changed our policy for accepting new clients in a way, that instead of accepting new clients only to disconnect them immediately, since that would overcommit the limit, we temporarily disable polling for the dedicated file descriptor, so any new connection will queue on the socket. Commit 8b1f0469 then added the possibility to change the limits during runtime but it didn't re-enable polling for the previously disabled file descriptor, thus any new connection would still continue to queue on the socket. This patch forces an update of the services each time the limits were changed in some way. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357776 Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reproduced with libvirt-2.0.0-2.el7.x86_64. Test steps are as comment 0. Verified pass with libvirt-2.0.0-5.el7.x86_64. Test steps: 1.Set max_clients limit in libvirtd.conf max_clients = 2 max_anonymous_clients = 2 2. Restart libvirtd sevice 3. #virt-admin srv-clients-info libvirtd nclients_max : 2 nclients : 0 nclients_unauth_max : 2 nclients_unauth : 0 4.Open two terminals, connect a virsh client in each terminal: # virsh -c qemu:///system 5.# virt-admin srv-clients-info libvirtd nclients_max : 2 nclients : 2 nclients_unauth_max : 2 nclients_unauth : 0 6. Increase max_clients limit: # virt-admin srv-clients-set libvirtd --max-clients 5 7# virt-admin srv-clients-info libvirtd nclients_max : 5 nclients : 2 nclients_unauth_max : 5 nclients_unauth : 0 8.Connect 3 new virsh client to libvirtd, all connect correctly: # virsh -c qemu:///system 9.Connect another new virsh client to libvirtd: #virsh -c qemu:///system (hangs)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html