Bug 809459

Summary: Operations with asynchronous jdbc cache store are blocking
Product: [JBoss] JBoss Data Grid 6 Reporter: Martin Gencur <mgencur>
Component: unspecifiedAssignee: Tristan Tarrant <ttarrant>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jdg-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-04 12:48:39 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:
Attachments:
Description Flags
TRACE log for asynchronous cache store
none
Example configuration - standalone.xml using H2 DB none

Description Martin Gencur 2012-04-03 12:36:44 UTC
Created attachment 574851 [details]
TRACE log for asynchronous cache store

Description of problem:

Running the following test suggests that storing entries into a cache with a defined async cache store blocks current thread until the entry is really stored in the database: https://svn.devel.redhat.com/repos/jboss-qa/edg/edg-functional-tests/trunk/remote/jdbc-cache-store/async-store-smoke/src/test/java/com/jboss/datagrid/cachestore/jdbc/stringbased/AsyncJdbcStringBasedCacheStoreTest.java

Storing 200 entries via memcached client into a cache with async cache store took on my computer (and remote PostgreSQL DB) ~86 seconds while with synchronous cache store it took ~90 seconds. When I remove the cache store definition completely, it takes hundreds of milliseconds.

Comment 1 Martin Gencur 2012-04-03 12:41:58 UTC
Created attachment 574853 [details]
Example configuration - standalone.xml using H2 DB

Comment 2 Tristan Tarrant 2012-04-03 12:47:45 UTC
I have tested this on H2 and MySQL locally, and could not reproduce it

Comment 3 Martin Gencur 2012-04-03 14:08:48 UTC
Not sure this is reproducible with a locally running database. I've tested with H2 too and the numbers were 223ms for sync and 157ms for async. IMO it should be hundreds of milliseconds even for the remote DB as the calls should return immediately and storing the keys into the cache store should run in the background.