mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 09:26:03 +00:00
fix(computes): hosts that do not answer no longer keep the Computes page from the others
The Computes page read its hosts on a pool of eight threads shared by the process: eight hosts that hang held all of them for as long as they hung, and every other host was then shown not connected. Each host is now read on a thread of its own (a daemon thread, which does not keep the process from exiting), one at a time per host as before. The UUID of a host added before host UUIDs were kept is read on that thread too, within the page's wait, instead of after it. A host's charts asked for each reading without a time limit: a reading the host kept waiting left the charts saying "Updated" and stopped the polling. A reading now ends after 30 s; the charts then say since when they are not updated, and the next reading goes out.
This commit is contained in:
parent
a998e68757
commit
1f6cc15ddf
5 changed files with 93 additions and 32 deletions
|
|
@ -141,12 +141,13 @@ class Compute(Model):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def record_host(self):
|
||||
"""Reads and keeps the UUID of the host the compute reaches (host_uuid)
|
||||
while its connection is still the one read with; its UUID, or ""
|
||||
when it cannot be read. IntegrityError when another compute is that host."""
|
||||
def record_host(self, uuid=None):
|
||||
"""Reads (unless given) and keeps the UUID of the host the compute
|
||||
reaches (host_uuid) while its connection is still the one read with;
|
||||
its UUID, or "" when it cannot be read. IntegrityError when another
|
||||
compute is that host."""
|
||||
try:
|
||||
uuid = self.proxy.host_uuid()
|
||||
uuid = uuid or self.proxy.host_uuid()
|
||||
except libvirtError:
|
||||
return ""
|
||||
with transaction.atomic():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue