Bug 954011 - Operations create sessions that live forever resulting in OutOfMemoryError
Summary: Operations create sessions that live forever resulting in OutOfMemoryError
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Operations
Version: JON 3.0.1
Hardware: All
OS: All
medium
medium
Target Milestone: ER01
: JON 3.2.0
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 953955
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-19 21:39 UTC by Larry O'Leary
Modified: 2018-12-01 15:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 953955
Environment:
Last Closed: 2014-01-02 20:43:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 354803 0 None None None Never

Description Larry O'Leary 2013-04-19 21:39:26 UTC
+++ This bug was initially created as a clone of RHQ Bug #953955 +++

Description of problem:
We have a bug in the operations jobs code where we authenticate the user who scheduled the operation and never log him out.

Consequently, the SessionManager cache keeps accumulating entries.

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

How reproducible:
Always

Steps to Reproduce:
1. 
2.
3.
  
Actual results:


Expected results:


Additional info:

See call hierarchies of org.rhq.enterprise.server.operation.OperationJob#getUserWithSession

The fix should make operation jobs log out the users and if possible the Session manager automatically evict timed out sessionq (with something like a task in a ScheduledExecutor).

Comment 1 John Mazzitelli 2013-04-24 00:22:02 UTC
A few things:

1) the session manager never purged timed out sessions unless someone logged out (during a logout, we would scrub all timed out sessions). We need a periodic job to clean out any sessions no matter what is going on with user login/logout.

2) the operation job code is creating multiple sessions when it only should be creating one

3) the operation job code should log out of the sessions it creates - this will remove the session from the manager and not leak the session.

Comment 2 John Mazzitelli 2013-04-24 03:47:20 UTC
git commit to master: cbfe893ad59715428bc8f72763c5b67f6b236779

Comment 4 John Mazzitelli 2013-04-30 18:58:36 UTC
note - I think a workaround for this is to periodically log in as a user (ANY user) and then immediately log out. This should trigger the session purge code.

You might even be able to schedule a cron job to log in and out using the CLI.

I haven't tested any of this, but the code to scrub old sessions is in the logout workflow, so presumably logging in and out of a CLI session or Web session would help clean up any old sessions and clean up any "leaked" sessions.

Might be something for customers to try if they are hitting this issue as a temporary workaround.

Comment 5 Larry O'Leary 2013-09-06 14:33:29 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.


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