[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XENVIF PATCH] Early-stop state wait when backend disappears



Reviewed-by: Owen Smith <owen.smith@xxxxxxxxx>

This does look like a pretty tight race between the frontend trying to gracefully close, and the backend deleting the xenstore entries. This change also affects the wait for backend state that's used in FrontendPrepare, but removing the backend here should result in the VIF being removed from the VM.

On Fri, Aug 29, 2025 at 10:34 AM Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx> wrote:
During VIF unplug, if the backend disappears before FrontendWaitFor-
BackendXenbusStateChange is called, that function will block at
XenbusStateUnknown and cause the system to hang until the timeout
expires.

Break out of the watch loop as soon as this condition is detected to
avoid this hang.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xenvif/frontend.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index c497f24..daeab9c 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1404,7 +1404,12 @@ FrontendWaitForBackendXenbusStateChange(
                               __FrontendGetBackendPath(Frontend),
                               "state",
                               &Buffer);
-        if (!NT_SUCCESS(status)) {
+        if (status == STATUS_OBJECT_NAME_NOT_FOUND) {
+            *State = XenbusStateUnknown;
+            Trace("%s disappeared\n",
+                  __FrontendGetBackendPath(Frontend));
+            break;
+        } else if (!NT_SUCCESS(status)) {
             *State = XenbusStateUnknown;
         } else {
             *State = (XenbusState)strtol(Buffer, NULL, 10);
--
2.51.0.windows.1



Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.