Bug 215885

Summary: [Cygwin] The kill-old-processes script should terminate every python process
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: Tools / TestsAssignee: Per Arne Vollan <pvollan>
Status: NEW ---    
Severity: Normal CC: aakash_jain, bfulgham, ews-watchlist, jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch pvollan: review?

Description Per Arne Vollan 2020-08-27 08:09:24 PDT
In order to avoid hanging python processes listening to http server ports, the kill-old-processes script should terminate every python process, except for the python process running the script.
Comment 1 Per Arne Vollan 2020-08-27 08:12:09 PDT
Created attachment 407399 [details]
Patch
Comment 2 Jonathan Bedard 2020-08-27 08:27:40 PDT
Comment on attachment 407399 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407399&action=review

> Tools/BuildSlaveSupport/kill-old-processes:139
> +        cmd = "ps af | grep -E '.+/python' | grep -v grep | grep -v " + str(os.getpid()) + " | awk '{print $2}' | xargs kill -9"

Isn't builedbot also a python process?
Comment 3 Per Arne Vollan 2020-08-27 08:30:37 PDT
(In reply to Jonathan Bedard from comment #2)
> Comment on attachment 407399 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407399&action=review
> 
> > Tools/BuildSlaveSupport/kill-old-processes:139
> > +        cmd = "ps af | grep -E '.+/python' | grep -v grep | grep -v " + str(os.getpid()) + " | awk '{print $2}' | xargs kill -9"
> 
> Isn't builedbot also a python process?

Ah, that is a good point! It might very well be. In Cygwin, it seems there is no information from ps about what script a python process is running.
Comment 4 Jonathan Bedard 2020-08-27 08:44:12 PDT
(In reply to Per Arne Vollan from comment #3)
> (In reply to Jonathan Bedard from comment #2)
> > Comment on attachment 407399 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=407399&action=review
> > 
> > > Tools/BuildSlaveSupport/kill-old-processes:139
> > > +        cmd = "ps af | grep -E '.+/python' | grep -v grep | grep -v " + str(os.getpid()) + " | awk '{print $2}' | xargs kill -9"
> > 
> > Isn't builedbot also a python process?
> 
> Ah, that is a good point! It might very well be. In Cygwin, it seems there
> is no information from ps about what script a python process is running.

Wonder if we could preserve only the oldest Python process (which should be buildbot)
Comment 5 Radar WebKit Bug Importer 2020-09-03 08:10:12 PDT
<rdar://problem/68279416>