Bug 1002444

Summary: Filter returns empty list if the plugin filter method is failing
Product: Red Hat Enterprise Virtualization Manager Reporter: Laszlo Hornyak <lhornyak>
Component: ovirt-scheduler-proxyAssignee: Martin Sivák <msivak>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, dfediuck, eedri, iheim, jmoskovc, mavital, sbonazzo
Target Milestone: ---Keywords: ZStream
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: ovirt-3.4.0-beta2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1069214 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1069214, 1078909, 1142926    

Description Laszlo Hornyak 2013-08-29 08:41:13 UTC
Description of problem:
Filter returns empty list if the plugin filter method is failing

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Create a plugin with filter function
def filterFunction(hosts, vm, args):
    '''This is a simple filter that returns all given host ID'''
    fail(yourself)
    pass
2. call filter with the name of the plugin


Actual results:
empty list

Expected results:
exception

Additional info:

Comment 1 Laszlo Hornyak 2013-08-29 08:41:55 UTC
this should be also true for scoreFunction and balanceFunction

Comment 5 Artyom 2013-11-28 15:34:57 UTC
Verified on is25

Comment 6 Artyom 2013-12-05 14:54:23 UTC
After discussion with Doron and Martin revealed that, if filter is corrupted or missing external scheduler must return all hosts and vm must run.

Comment 7 Artyom 2013-12-06 06:51:27 UTC
Checked on is26,
Can't run vm, when corrupted filter function is added to ovirt-sheduler-proxy
engine.log:
Cant find VDS to run the VM 687e60b6-5632-4c97-80c1-23a63f61c550 on, so this VM will not be run

ovirt-sheduler-proxy.log
Fri, 06 Dec 2013 08:46:21 DEBUG    [process:MainProcess, thread:Thread-6] [Request:1dcc4f1e-5e42-11e3-a884-001a4a1697fa][Method:PythonMethodRunner] - running ['python', '-c', "import max_vm_filter; max_vm_filter.max_vms().do_filter(['1ab5d0d9-5f2d-4994-8f6e-773870b1d1a0'], '687e60b6-5632-4c97-80c1-23a63f61c550', {})"] in /usr/share/ovirt-scheduler-proxy/plugins
Fri, 06 Dec 2013 08:46:21 DEBUG    [process:MainProcess, thread:Thread-5] [Request:1dcc4f1e-5e42-11e3-a884-001a4a1697fa][Method:run_filters] - Waiting for filters to finish
Fri, 06 Dec 2013 08:46:22 ERROR    [process:MainProcess, thread:Thread-6] [Request:1dcc4f1e-5e42-11e3-a884-001a4a1697fa][Method:PythonMethodRunner] - script ['python', '-c', "import max_vm_filter; max_vm_filter.max_vms().do_filter(['1ab5d0d9-5f2d-4994-8f6e-773870b1d1a0'], '687e60b6-5632-4c97-80c1-23a63f61c550', {})"] got error Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "max_vm_filter.py", line 34, in do_filter
    asd
NameError: global name 'asd' is not defined

Fri, 06 Dec 2013 08:46:22 DEBUG    [process:MainProcess, thread:Thread-5] [Request:1dcc4f1e-5e42-11e3-a884-001a4a1697fa][Method:run_filters] - Aggregating results
Fri, 06 Dec 2013 08:46:22 WARNING  [process:MainProcess, thread:Thread-5] Error in ['python', '-c', "import max_vm_filter; max_vm_filter.max_vms().do_filter(['1ab5d0d9-5f2d-4994-8f6e-773870b1d1a0'], '687e60b6-5632-4c97-80c1-23a63f61c550', {})"] (errno: 1, errors: Traceback (most recent call last):
File "<string>", line 1, in <module>
  File "max_vm_filter.py", line 34, in do_filter
    asd
NameError: global name 'asd' is not defined
)
Fri, 06 Dec 2013 08:46:22 INFO     [process:MainProcess, thread:Thread-5] [Request:1dcc4f1e-5e42-11e3-a884-001a4a1697fa][Method:run_filters] - returning: []

So if filter failed, ovirt-sheduler-proxy return empty list

Comment 8 Itamar Heim 2013-12-08 09:15:48 UTC
isn't this now a dup of bug 1002443?

Comment 10 Jiri Moskovcak 2014-01-22 11:55:41 UTC
*** Bug 1002443 has been marked as a duplicate of this bug. ***

Comment 11 Eyal Edri 2014-02-10 09:50:49 UTC
moving to 3.3.2 since 3.3.1 was built and moved to QE.
bug was fixed a while ago, please make sure to clone to z-stream if it needs to make the build.

Comment 12 Artyom 2014-02-13 15:05:46 UTC
Verified on ovirt-engine-3.4.0-0.7.beta2.el6.noarch
If filter failed and no other filters scheduler return the full vdsm list.

Comment 14 Itamar Heim 2014-06-12 14:10:59 UTC
Closing as part of 3.4.0