testbot: Document a harmless race in the task startup and its consequences.

Francois Gouget fgouget at codeweavers.com
Tue Mar 26 04:54:31 CDT 2013


---
 testbot/lib/WineTestBot/Tasks.pm |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 56028d8..8ca9da0 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -129,6 +129,10 @@ sub Run
     exit(1);
   }
 
+  # Note that if the child process completes quickly (typically due to some
+  # error), it may set ChildPid to undef before we get here. So we may end up
+  # with non-running tasks for which ChildPid is set. That's ok because
+  # ChildPid should be ignored anyway if Status is not 'running'.
   $self->ChildPid($Pid);
   $self->Started(time);
   my ($ErrProperty, $ErrMessage) = $self->Save();
@@ -206,6 +210,7 @@ BEGIN
     CreateItemrefPropertyDescriptor("VM", "VM", !1,  1, \&CreateVMs, ["VMName"]),
     CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4),
     CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256),
+    # Note: ChildPid is only valid when Status == 'running'.
     CreateBasicPropertyDescriptor("ChildPid", "Child process id", !1, !1, "N", 5),
     CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19),
     CreateBasicPropertyDescriptor("Ended", "Execution ended", !1, !1, "DT", 19),
-- 
1.7.10.4




More information about the wine-patches mailing list