Bugs item #938422, was opened at 2004-04-20 08:43
Message generated for change (Comment added) made by ejort
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=938422&group_id=22866
Category: JBossCX
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: MarcMA (marcma12)
Assigned to: Adrian Brock (ejort)
Summary: Negative ConnectionCount after killing conns
Initial Comment:
WXP Pro., Linux Debian.
JDK 1.4.2_03
sse-ds-xml is attached.
server.log is partially attached.
JBoss 3.2.3 / JBoss 3.2.4RC1 (same problem), Sybase
12, Jconn2 (5.5)
Problem:
After killing connections from the databaseside manually
or by accident (db-probs) the ManagedConnectionPool
destroys the connections, but reanimates them after a
certain period of time. It also counts negative amounts
of connections while destroying them. Maybe it is
destroying the connections twice?
Result:
There are more connections used by jboss than
managed by pool. The more fatal db errors the more
connections get lost.
Reproduce:
Prepare a setting. Watch the amount of connections in
the MBean for the MCP. Watch the amount of
connections from the databaseside (sp_who). Kill all
opened connections from the databaseside (kill in isql).
Again have a look at the connections from the
databasside. All connections are gone. Watch the MBean
for MCP. ConnectionCount=5. (The pool did not realize
yet).
Wait minimum idle-timout-minutes or do an application
request. The pool gets destroyed. ConnectionCount=-5
or -4. Depends on the load of the request you have
done. Again wait minimum idle-timeout-minutes. Watch
amount of connections from the databaseside. Amount
of connections=10. Watch ConnectionCount from MCP
MBean. It says 5. Wait up to 24hours. Nothing changes.
Still 10 opened connections.
Hmm. Makes 5 lost connections.
----------------------------------------------------------------------
>Comment By: Adrian Brock (ejort)
Date: 2004-04-20 12:22
Message:
Logged In: YES
user_id=9459
No it is not ignorable.
It is a related problem in the same code path.
I have already fixed it.
I will be posting details of the patch in the JBoss/JCA forum
shortly.
----------------------------------------------------------------------
Comment By: MarcMA (marcma12)
Date: 2004-04-20 12:11
Message:
Logged In: YES
user_id=1024520
Ok. Very good!
The changes do the trick for me. ;)
Everything is nice and neet. Problem sorted.
But why is AvailableConnectionCount wrong? It shows exactly
the maxsize pool + amount of killed connections. (35 in our
scenario). Killing again means ending up with ACC=40.
Is this ignorable, or are there any strong dependencies that
could lead into trouble when using these patches in
production?
Cheers
PS: Thanks a mill. so far.
----------------------------------------------------------------------
Comment By: Adrian Brock (ejort)
Date: 2004-04-20 10:02
Message:
Logged In: YES
user_id=9459
Thanks for the detailed explanation and the log.
I can see the problem, I was correct that doDestroy was
invoked twice.
You should be able to fix it with the following change to
doDestroy
(NOTE: I haven't tested this yet, I need to reproduce it for
myself first)
The problem is that getConnection() invokes doDestroy
directly for a broken connection which bypasses the check
for destroyed in returnManagedConnection()
In your case, it has already been destroyed when
the managed connection fired a connectionErrorOccured event.
private void doDestroy()
{
// NEW CODE
if (cl.getState() == ConnectionListener.DESTROYED)
{
log.trace("ManagedConnection is already destroyed "
+ cl);
return;
}
// END NEW CODE
connectionCounter.dec();
cl.setState(ConnectionListener.DESTROYED);
try
{
cl.getManagedConnection().destroy();
}
catch (Throwable t)
{
log.warn("Exception destroying ManagedConnection "
+ cl, t);
}
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=938422&group_id=22866
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development