Bug 1247545

Summary: Large bundle deployment results in OOM in agent log if deploy.xml has attribute replace="true"
Product: [JBoss] JBoss Operations Network Reporter: Sunil Kondkar <skondkar>
Component: ProvisioningAssignee: Lukas Krejci <lkrejci>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.3.3CC: fbrychta, miburman
Target Milestone: ---   
Target Release: JON 3.3.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-26 14:50:19 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
stacktrace_AgentLog
none
BundleDeploy_AuditMessage none

Description Sunil Kondkar 2015-07-28 09:45:57 UTC
Description of problem:

When tried to deploy a large size bundle to a platform, the agent log displays "Failed to deploy bundle [Large File Test Bundle] version [1.0]: java.lang.OutOfMemoryError: Java heap space".

Please refer the attached stack trace and screenshot.

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

3.3.0.GA Update 03
Build Number :	
edc324f:119e8f4

How reproducible:

Always

Steps to Reproduce:

1.  Install and start JBoss ON 3.3.3CR01.
2.  Build a bundle archive that is at least 80 MB in size.

    ~~~
tmpDir="`mktemp -d`"

cat >"${tmpDir}"/deploy.xml <<EOF
<?xml version="1.0"?>
<project name="largeFile"
         default="main"
         xmlns:rhq="antlib:org.rhq.bundle">
  <target name="main" />

  <rhq:bundle name="Large File Test Bundle"
              version="1.0"
              description="A sample bundle consisting of a single large file">
    <rhq:deployment-unit name="files"
                         compliance="filesAndDirectories">
EOF

mkdir "${tmpDir}"/files
for file in {001..001}; do
    echo "This is File #${file}." > "${tmpDir}/files/file-${file}.txt"
    dd if=/dev/urandom of="${tmpDir}/files/file-${file}.bin" bs=8M count=10
    echo '      <rhq:file name="files/file-'"${file}"'.txt" destinationFile="files/file-'"${file}"'.txt" replace="true" />' >> "${tmpDir}"/deploy.xml
    echo '      <rhq:file name="files/file-'"${file}"'.bin" destinationFile="files/file-'"${file}"'.bin" replace="true" />' >> "${tmpDir}"/deploy.xml
done

cat >>"${tmpDir}"/deploy.xml <<EOF
    </rhq:deployment-unit>
  </rhq:bundle>
</project>
EOF
(cd "${tmpDir}" && zip -r /tmp/large-bundle.zip .)
rm -rf "${tmpDir}"
ls -al /tmp/large-bundle.zip

    ~~~

3.  Create a bundle group:

    *   *Name:* `Test01 - Bundle Group`

4. Create new bundle using _/tmp/large-bundle.zip_ and assign it to the _Test01 - Bundle Group_ bundle group.

5. After bundle is created, select the bundle from Bundles menu in UI and click Deploy.
6. Enter Destination name, Select Resource Group as 'DynaGroup - Groups By Platform (Linux).
7. Enter Destination Directory (Ex: /tmp/Test) and click Next.
8. Select Deployment version and click Next->Next->Next and Finish.
9. Observe the agent log for errors.

Actual results:

Large bundle deployment results in OOM error in agent log if deploy.xml has attribute replace="true"

Expected results:

No errors

Additional info:

1) The bundle gets deployed successfully without error if I set : RHQ_AGENT_JAVA_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true" in 'agentRoot/rhq-agent/bin/rhq-agent-env.sh'

2) If the attribute 'replace in deploy.xml is changed to false (replace="false"). The deployment is successful without errors.

Comment 1 Sunil Kondkar 2015-07-28 09:46:39 UTC
Created attachment 1056982 [details]
stacktrace_AgentLog

Comment 2 Sunil Kondkar 2015-07-28 09:47:21 UTC
Created attachment 1056983 [details]
BundleDeploy_AuditMessage