<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">"</span><span style="font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:19.7999992370605px">timeout 5m %s %s/dotest.py %s -p %s %s" will kill python after 5 minutes, but will it also kill any inferiors, and descendants of those? And what if you have A > B > C, and B dies, then you kill A's tree?</span></blockquote><div><br></div><div>As far as I can tell with my experimentation, timeout actually handles all of those cases perfectly. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">launching the process in a process group ("job" on windows)</span></blockquote><div><br></div><div>Could we do that portably?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">If it's not important then it seems like just running the process in a separate thread with a timeout would be sufficient.</span></blockquote><div><br></div><div>I think it's important. Since otherwise you'll finish the test but still end up with a bunch of processes taking up resources in the background. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 3:50 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I looked at this some more, and I'm not sure if there's really a good solution. I looked at the source code for psutil, and it also doesn't work correctly in case a process in the middle of the chain dies. I don't think TASKKILL /T does either. Does the original patch work with this case? "<span style="line-height:19.7999992370605px">timeout 5m %s %s/dotest.py %s -p %s %s" will kill python after 5 minutes, but will it also kill any inferiors, and descendants of those? And what if you have A > B > C, and B dies, then you kill A's tree? </span><br><div><br></div><div>If it's actually important to kill the tree then I think the only way to really do it correctly is with by launching the process in a process group ("job" on windows). If it's not important then it seems like just running the process in a separate thread with a timeout would be sufficient.</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote">On Mon Dec 01 2014 at 3:27:45 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">On Mon Dec 01 2014 at 3:19:09 PM Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">Currently when the tests lock up on the build server, the build script kills the tests and gets *no* test results. That means that if a bug goes in that causes a test to hang, we don't get results for *any* tests.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Killing the individual test causes it to show up as a FAIL (Chaoren might change this to show result as "TIMEOUT")</span></div></div></blockquote><div> </div></div><div class="gmail_quote"><div>I see, this wasn't clear before. I understood that the bots would already kill individual tests that hanged, and not fail the entire test suite.<br></div></div><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>It's not really about what tests are hanging today, it's that some day a test will hang. When that happens, do we want to lose all test results as a result? Look at the Linux buildbot history. Many runs have no test results at all. Which test caused the lockup? I have no idea.</div></div><div dir="ltr"><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">> Both of those options are really undesirable in my opinion.</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">We can make the test timeout be an OSX/Linux thing only for now...</span></div></div></blockquote></div><div class="gmail_quote"><div>How bad would it be to just use psutil? We could integrate it with the build so that it builds psutil when you build lldb, and deploys it to the same place that lldb's python module goes so that it's automatically in the PYTHONPATH.</div><div><br></div><div>Eventually we're going to need this on other platforms too, and it benefits everyone if we can share code instead of implementing things differently on each platform.</div></div></blockquote></div>
</div></div></blockquote></div><br></div>