Bug 215885 - [Cygwin] The kill-old-processes script should terminate every python process
Summary: [Cygwin] The kill-old-processes script should terminate every python process
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-27 08:09 PDT by Per Arne Vollan
Modified: 2020-09-03 08:10 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2020-08-27 08:12 PDT, Per Arne Vollan
pvollan: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>