Bug 1231658 - [GSS] (6.4.z) Prefill race condition in flush
Summary: [GSS] (6.4.z) Prefill race condition in flush
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA
Version: 6.4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR2
: EAP 6.4.5
Assignee: Dominik Pospisil
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks: 1235745 1278301
TreeView+ depends on / blocked
 
Reported: 2015-06-15 07:45 UTC by Takayoshi Kimura
Modified: 2020-11-04 17:35 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
server.log (64.38 KB, text/plain)
2015-06-15 07:45 UTC, Takayoshi Kimura
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1277919 0 unspecified CLOSED [QE](6.4.z) Peculiar behavior of data source pool statistics 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker JBJCA-1276 0 Major Closed Prefill race condition in flush 2020-11-04 17:04:52 UTC
Red Hat Knowledge Base (Solution) 2143431 0 None None None 2020-11-04 17:35:11 UTC

Internal Links: 1277919

Description Takayoshi Kimura 2015-06-15 07:45:30 UTC
Created attachment 1038802 [details]
server.log

There is a race condition between AbstractPool and SemaphoreArrayListManagedConnectionPool.

https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.31.Final/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java#L354
https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.31.Final/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreArrayListManagedConnectionPool.java#L625

AbstractPool flushes the mcp, mcp invokes PoolFiller which works in a separate thread. However AbstractPool is going to unregister the empty mcp and this mcp is no longer used. Then the dead mcp is prefilled in a separate thread by PoolFiller.

At next getConnection(), the mcp is re-initialized and prefilled.

I've attached logs, prefill enabled and min-size is 10. Boot server, invoke flush-all-connection-in-pool, getConnection() then killed. The prefill is done 3 times where it should be twice.

Comment 1 Takayoshi Kimura 2015-06-15 07:59:18 UTC
In 1.0.31.Final:

> if (mcp.isEmpty())
>    clearMcpPools.add(mcp);

In 1.2 branch, commit 956af09c8494d4187db24a253e7e37b5ba5d9779 for JBJCA-1135:

> if (mcp.isEmpty() && !isPrefill() && size > 1)
>    clearMcpPools.add(mcp);

We probably need to backport "!isPrefill()" to the 1.0 branch.

Comment 2 Dominik Pospisil 2015-07-09 09:19:56 UTC
Upstream PR sent: https://github.com/ironjacamar/ironjacamar/pull/366

Comment 4 Dominik Pospisil 2015-08-18 14:04:43 UTC
Merged.

Comment 5 JBoss JIRA Server 2015-10-15 19:15:29 UTC
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1276 to Resolved

Comment 6 JBoss JIRA Server 2015-10-26 11:46:47 UTC
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1276 to Closed

Comment 8 Jan Martiska 2015-11-04 06:59:05 UTC
Verified with EAP 6.4.5.CR1.

Comment 9 Jan Martiska 2015-11-06 09:46:15 UTC
The fix for this caused a regression: https://bugzilla.redhat.com/show_bug.cgi?id=1277919
Therefore, keeping this reopened for now.

Comment 10 Vaclav Tunka 2015-11-09 16:12:21 UTC
Fix is in 1.0.34, so marking this as MODIFIED:
https://github.com/ironjacamar/ironjacamar/commit/1511519f23450e06dd84faaf512ebe37416a8ad4

Comment 11 Jan Martiska 2015-11-12 10:54:45 UTC
Verified with EAP 6.4.5.CR2, including the regression previously introduced.

Comment 12 Petr Penicka 2017-01-17 11:42:51 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 13 Petr Penicka 2017-01-17 11:43:05 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


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