1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 04:36:48 +00:00

fix(vrtManager): a request whose read of other hosts fails counts on its host again

other_hosts counted the request on its own host again only when the
block ended normally: a quota check that raised left the request
counted on the other host while it went on with its own. The count is
now restored however the block ends.
This commit is contained in:
catborise 2026-11-05 08:49:17 +03:00
parent d4b9edc3e5
commit 3c51602652
2 changed files with 15 additions and 4 deletions

View file

@ -147,9 +147,11 @@ def other_hosts():
then goes on with the host it used before, through the objects it kept:
the request counts on that host again after the block (HOST_REQUESTS)."""
held = getattr(_request, "held", None)
yield
if held is not None:
_count_on(held)
try:
yield
finally:
if held is not None:
_count_on(held)
request_started.connect(_request_started, dispatch_uid="vrtManager.connection.request_started")