Bug 1293370

Summary: When worker killer is invoked, you get undefined method sort!
Product: Red Hat CloudForms Management Engine Reporter: Jason Frey <jfrey>
Component: ApplianceAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED ERRATA QA Contact: Pavol Kotvan <pakotvan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.5.0CC: abellott, cpelland, jhardy, jprause, mfeifer, nachandr, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.6.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1293374 (view as bug list) Environment:
Last Closed: 2016-06-29 15:22:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1293374    

Description Jason Frey 2015-12-21 15:13:59 UTC
Description of problem:
When the appliance runs low on memory, the worker killer is invoked.  The following error is raised:

[NoMethodError]: undefined method `sort!' for #<MiqAutomateWorker::ActiveRecord_Relation:0x0000000ca46ff8>  Method:[rescue in monitor]
/gems/ruby-2.0.0-p598/gems/activerecord-4.2.4/lib/active_record/relation/delegation.rb:136:in `method_missing'
/gems/ruby-2.0.0-p598/gems/activerecord-4.2.4/lib/active_record/relation/delegation.rb:99:in `method_missing'
/app/models/miq_server/worker_management/monitor.rb:110:in `block in do_system_limit_exceeded'
/app/models/miq_server/worker_management/monitor.rb:101:in `each'
/app/models/miq_server/worker_management/monitor.rb:101:in `do_system_limit_exceeded'

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

How reproducible:
Always

Steps to Reproduce:
1. Fill up the system with worker
2. Wait for memory to run out
3. See error in log

Actual results:
Boom

Expected results:
The worker killer should kill some workers to reclaim memory, and log an appropriate error message when it does so.

Additional info:
Fixed in upstream PR https://github.com/ManageIQ/manageiq/pull/5916

Comment 4 errata-xmlrpc 2016-06-29 15:22:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348