Bug 1202427 - Automate: Methods fails with DRb "is recycled object" exception
Summary: Automate: Methods fails with DRb "is recycled object" exception
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.4.0
Assignee: mkanoor
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-16 15:16 UTC by mkanoor
Modified: 2015-06-16 12:53 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-16 12:53:18 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Description mkanoor 2015-03-16 15:16:45 UTC
Description of problem:
When an automate method runs we get a recycled object exception.

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

How reproducible:

Depends on when the Ruby Garbage collector runs, if the object is deleted on the Automate Engine side (server) and the automate method (client) needs to use it.

Steps to Reproduce:
1. Make sure that the RedHat domain is present in automate
2. Do a VM provisioning by default we run the vmware_best_fit_with_scope.rb or redhat_best_placement_with_scope.rb
3. The above methods use the prov.check_quota(:active_provisions) which returns a Ruby Hash with default proc.
4. The provision might fail, its not guaranteed because we depend on when the Ruby Garbage collector frees up the objects

Actual results:
Automate method fails and stops the provisioning

Expected results:
Automate method should succeed

Additional info:

This bug was introduced when we removed the GC.disable before we dispatched an automate method. This code is present only in 5.4 and bugs like these are difficult to reproduce.

Comment 2 CFME Bot 2015-03-17 21:40:54 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/af95cd753f78be70075bbf9a027df5dc4835ef64

commit af95cd753f78be70075bbf9a027df5dc4835ef64
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Tue Mar 17 14:33:58 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Mar 17 14:33:58 2015 -0400

    Added drb_return in check_quota
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1202427
    
    Hashes with default_proc are sent to the client as references
    which need to exist on the server side while the automate method
    is running.

 .../service_models/mixins/miq_ae_service_miq_provision_mixin.rb         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 4 Shveta 2015-04-24 22:48:46 UTC
The provision is successful when Redhat domain is enabled.
But In automation logs vmware_best_fit_with_scope.rb or redhat_best_placement_with_scope.rb is not seen .

Comment 5 mkanoor 2015-04-27 13:59:00 UTC
You would have to copy the methods in /RedHat/Infrastructure/VM/Provisioning/Placement/
as default. This will cause one of those methods to be used.
Also you would have to enable tagging for this provision to work.

By default the Provisioning uses
/ManageIQ/Infrastructure/VM/Provisioning/Placement/default

Comment 6 Shveta 2015-04-27 22:39:55 UTC
Steps to Verify ; 
1. Copy the Modify the /ManageIQ/Infrastructure/VM/Provisioning/Placement/Default instance to your own writable domain.
2. Modify your newly copied instance: YOURDOMAIN/Infrastructure/VM/Provisioning/Placement/Default.
   Change redhat_best_fit_cluster to redhat_best_placement_with_scope
   Change vmware_best_fit_least_utilized to vmware_best_fit_with_scope
3. Provision VM .
4. In Automation logs look for : 
 Invoking [inline] method [/Default/Infrastructure/VM/Provisioning/Placement/vmware_best_fit_with_scope] with inputs [{}]


Provision successful  and methods seen in logs.

Comment 7 Ramesh A 2015-05-29 20:10:37 UTC
Git hub link - https://github.com/ManageIQ/manageiq/issues/2150

Comment 9 errata-xmlrpc 2015-06-16 12:53:18 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://rhn.redhat.com/errata/RHBA-2015-1100.html


Note You need to log in before you can comment on or make changes to this bug.