Bug 97647 - A buggy python patch can kill all EWS bots
Summary: A buggy python patch can kill all EWS bots
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-26 02:10 PDT by Csaba Osztrogonác
Modified: 2018-12-28 22:59 PST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2012-09-26 02:10:47 PDT
https://bugs.webkit.org/attachment.cgi?id=165713 in https://bugs.webkit.org/show_bug.cgi?id=97623
killed all EWS bots, they stucked in an infinite loop with the following error:

Traceback (most recent call last):
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkit-patch", line 84, in <module>
    main()
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkit-patch", line 79, in main
    WebKitPatch(os.path.abspath(__file__)).main()
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/tool/main.py", line 55, in __init__
    MultiCommandTool.__init__(self)
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 221, in __init__
    self.commands = commands or [cls() for cls in self._find_all_commands() if cls.name]
  File "/mnt/git/webkit-style-queue/Tools/Scripts/webkitpy/tool/commands/rebaseline.py", line 185, in __init__
    AbstractRebaseliningCommand.__init__(self, options=port_options(platform='port/platform to use. Use glob-style wildcards for multiple ports'))
NameError: global name 'port_options' is not defined


We need a proper way to avoid this kind of problems in the future.
Comment 1 Eric Seidel (no email) 2012-09-26 08:10:36 PDT
All the bots Adam and I run use a wrapper script which cleans the repository every N runs.

http://trac.webkit.org/browser/trunk/Tools/EWSTools/start-queue.sh

Note the git clean and the test-webkit-py invocations.

Are those not working?
Comment 2 Csaba Osztrogonác 2012-09-26 08:23:39 PDT
I use this script of course. But the problem was that EWS stucked in an infinite
loop and didn't exit to let this script to clean the repository. 

Here is the latest log I got:
------------------------------
Fetching: https://bugs.webkit.org/attachment.cgi?id=165715&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=97535&ctype=xml&excludefield=attachmentdata
Fetching: https://bugs.webkit.org/attachment.cgi?id=165715&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=97535&ctype=xml&excludefield=attachmentdata
Traceback (most recent call last):
  File "/storage/WebKit-qt-ews/Tools/Scripts/webkit-patch", line 84, in <module>
    main()
  File "/storage/WebKit-qt-ews/Tools/Scripts/webkit-patch", line 79, in main
    WebKitPatch(os.path.abspath(__file__)).main()
  File "/storage/WebKit-qt-ews/Tools/Scripts/webkitpy/tool/main.py", line 55, in __init__
    MultiCommandTool.__init__(self)
  File "/storage/WebKit-qt-ews/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 221, in __init__
    self.commands = commands or [cls() for cls in self._find_all_commands() if cls.name]
  File "/storage/WebKit-qt-ews/Tools/Scripts/webkitpy/tool/commands/rebaseline.py", line 185, in __init__
    AbstractRebaseliningCommand.__init__(self, options=port_options(platform='port/platform to use. Use glob-style wildcards for multiple ports'))
NameError: global name 'port_options' is not defined
Unable to clean working directory
Unable to process work item.
Fetching: https://bugs.webkit.org/attachment.cgi?id=165715&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=97535&ctype=xml&excludefield=attachmentdata
Error: qt-ews did not process patch.
Unable to process work item.
Fetching: https://bugs.webkit.org/attachment.cgi?id=165717&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=97535&ctype=xml&excludefield=attachmentdata
Error: qt-ews did not process patch.
Unable to process work item.


And then EWS stucked in the infinite loop until I r- -ed the patch and restarted it manually.
Comment 3 Csaba Osztrogonác 2012-09-26 08:33:13 PDT
I don't know exactly how should we fix this bug ... 

My idea is we should detect somehow if the EWS stucked in an infinite loop.
Maybe with an external script with a given timeout ... EWS should signal to
this script if it finished a build and started the next one. If it didn't
finish in the timeout, the script can restart it with a clean env.

Additionally we should remove the buggy patch from the EWS queue 
after 2-3 retries to save the life of the EWS bots.
Comment 4 Adam Barth 2012-09-26 08:59:30 PDT
> Additionally we should remove the buggy patch from the EWS queue 
> after 2-3 retries to save the life of the EWS bots.

Yeah, that sounds like a good approach.  At least that will stop us from spinning on a patch forever.
Comment 5 Csaba Osztrogonác 2013-04-16 02:08:05 PDT
One more problem because of this bug, see https://bugs.webkit.org/show_bug.cgi?id=114668 for details.
Comment 6 Ryosuke Niwa 2013-04-16 02:10:25 PDT
I think EWS should create a copy of Tools/Scripts and use that instead.