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

Alexandre Julliard julliard at winehq.org
Tue Mar 26 11:52:22 CDT 2013


Module: tools
Branch: master
Commit: e7ea9b8e63644471762d7cf4fda4e7018f0dbe02
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=e7ea9b8e63644471762d7cf4fda4e7018f0dbe02

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Mar 26 10:54:31 2013 +0100

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

---

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

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),




More information about the wine-cvs mailing list