Bug 836097

Summary: restore snapshot to jenkins server on Windows(ruby-1.9) will get "failed to allocate memory" error
Product: OKD Reporter: Meng Bo <bmeng>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xKeywords: Triaged
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-13 23:43:21 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:
Attachments:
Description Flags
memory usage during restore none

Description Meng Bo 2012-06-28 06:26:40 UTC
Created attachment 594943 [details]
memory usage during restore

Description of problem:
When trying to restore jenkins server snapshot on Windows(ruby-1.9), a process named ruby.exe will use up the system physical memory after hit the 'rhc app snapshot restore -a jenkins' command and return "failed to allocate memory" error with restore failed.

Version-Release number of selected component (if applicable):
cartridge-jenkins-1.4-0.95.1-1.git.0.f303cda.el6.noarch
cartridge-jenkins-client-1.4-0.29.1-1.git.0.edfe387.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.create jenkins server app
2.take snapshot for this app
3.try to restore the snapshot for this app
  
Actual results:
ruby.exe use up the system physical memory(see attachment) and restore failed.

C:\Users\Administrator>rhc app snapshot restore -a jenkins -p123123 -d
Submitting form:
rhlogin: bmeng
debug: true
Contacting https://int.openshift.redhat.com
C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby.rb:416:in `[
]=': failed to allocate memory (NoMemoryError)
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:416:in `codes'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:364:in `dynamic_codes'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:260:in `inflate'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:580:in `initialize'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:605:in `new'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/vendor/zliby
.rb:605:in `open'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc/targz.rb:26:
in `contains'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/lib/rhc-common.rb:88
0:in `snapshot_restore'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/bin/rhc-app:398:in `
save_or_restore_snapshot'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.95.5/bin/rhc-app:513:in `
<top (required)>'
        from C:/Ruby193/bin/rhc-app:23:in `load'
        from C:/Ruby193/bin/rhc-app:23:in `<main>'

Expected results:
Snapshot should be restored successfully without any error.

Additional info:
This issue does not occur on Fedora 17 with ruby 1.9.
This issue does not occur for other types of apps.

Comment 1 Clayton Coleman 2012-07-05 22:24:53 UTC
Reading things into memory?  Memory leak?

Comment 2 Fabiano Franz 2012-07-11 21:07:20 UTC
Fixed. We removed for now the .tar.gz snapshot file from client when on Windows, since it was causing file locks and/or memory leaks.

Comment 3 Meng Bo 2012-07-12 10:36:25 UTC
Verified on rhc-0.95.13, issue has been fixed.



C:\Users\Administrator\Desktop>rhc app snapshot restore -a jenkins
Password:

Restoring from snapshot jenkins.tar.gz...

Stopping application...
Waiting for stop to finish
Done
Removing old data dir: ~/jenkins/app-root/data/*
Restoring ~/app-root/data
Starting application...
Done
Terminating...