Bug 887320 - Agent raise OutOfMemoryError when adding new Deployment child resource on AS7
Summary: Agent raise OutOfMemoryError when adding new Deployment child resource on AS7
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.5
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
: RHQ 4.6
Assignee: Thomas Segismont
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 887861
TreeView+ depends on / blocked
 
Reported: 2012-12-14 16:49 UTC by Thomas Segismont
Modified: 2013-09-03 14:43 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 887861 (view as bug list)
Environment:
Last Closed: 2013-09-03 14:43:51 UTC
Embargoed:


Attachments (Terms of Use)
Stack trace (42.03 KB, text/plain)
2012-12-14 16:50 UTC, Thomas Segismont
no flags Details

Description Thomas Segismont 2012-12-14 16:49:26 UTC
Description of problem:
When you try to add new deployment child to an AS7 resource, the agent raise an  OutOfMemoryError.

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

How reproducible:
Always

Steps to Reproduce:
1. Find a simple WAR to deploy
I tried with Jenkins http://mirrors.jenkins-ci.org/war/latest/jenkins.war
2. Go to an AS7 resource page, Inventory/Child Resources tab.
3. Click the toggle button Create Child/Deployment and upload you WAR, then Next and Finish
4. Go to the Inventory/Child History tab
  
Actual results:
The new Created Child history record ends with status failed. A big stack trace ending with OutOfMemoryError is in the history details (see attached stack trace).

Expected results:
The new Created Child history record ends with status success.

Additional info:
* Attached is the server stack trace. The error is catched and passed to the server so it's reported on the server but actually raised in the agent.
* Deploying the same war to a Tomcat 7 resource works. So it may be a problem only for the AS7 plugin

Comment 1 Thomas Segismont 2012-12-14 16:50:28 UTC
Created attachment 663660 [details]
Stack trace

Comment 2 Charles Crouch 2012-12-14 17:29:08 UTC
Notes:  http://mirrors.jenkins-ci.org/war/latest/jenkins.war is 46mb

Is this also a problem in jon311?

Comment 3 Thomas Segismont 2012-12-17 14:12:22 UTC
It's also a jon311 issue.

AS7 plugin uses HttpUrlConnection to talk with management API.

HttpUrlConnection keeps data in memory until output stream is closed if content length is unknown.
Setting transfer mechanism to chunks solves the problem.

master - 52bdd6f

Comment 4 Thomas Segismont 2012-12-17 22:34:48 UTC
master - 52bdd6f reverted

Fix worked by chance at first because there was an already active connection to as7.
But HttpUrlConnection does not support auth in streaming mode.

Comment 5 Thomas Segismont 2013-01-21 13:23:09 UTC
Bug fixed (ASUploadConnection now uses commons httpclient) instead of HttpUrlConnection from JDK.

master - 84b4cbc

Comment 6 Thomas Segismont 2013-04-08 21:31:45 UTC
Reworked to upgrade to HttpClient 4

master - 21ec5e2

Comment 7 Thomas Segismont 2013-04-09 10:07:39 UTC
Reworked to increased delay in AS7 itests to discover all resources
master - 3b18013

Comment 8 Thomas Segismont 2013-04-10 12:15:35 UTC
All unit and integration tests pass on my box and on Jenkins:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/RHQ/job/rhq-master/org.rhq$rhq-jboss-as-7-plugin/

Manual testing leads to expected results (see the steps listed in the original description of this bug)

Comment 9 Heiko W. Rupp 2013-09-03 14:43:51 UTC
Bulk closing of issues in old RHQ releases that are in production for a while now.

Please open a new issue when running into an issue.


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