[
https://issues.jboss.org/browse/ISPN-1556?page=com.atlassian.jira.plugin....
]
Gary Brown commented on ISPN-1556:
----------------------------------
Probably best if I provide more information, to see where the problem may be.
This is the cache configuration in AS7.1.0.Alpha2:
{code:xml}
<local-cache name="conversationDetails">
<eviction strategy="NONE" max-entries="10000"/>
<locking acquire-timeout="10000"/>
</local-cache>
{code}
In the code I obtain the cache and set the flags:
{code}
org.infinispan.Cache<ConversationId,ConversationDetails> conversationDetails=
_container.getCache("conversationDetails");
_conversationDetails = conversationDetails.getAdvancedCache()
.withFlags(Flag.FAIL_SILENTLY, Flag.ZERO_LOCK_ACQUISITION_TIMEOUT);
{code}
I then test the lock before doing the replace ....
{code}
try {
if (_conversationDetails.lock(result.getConversationId())) {
_conversationDetails.replace(result.getConversationId(), details);
} else {
// Trigger retry for this event
....
}
} catch(org.infinispan.util.concurrent.TimeoutException te) {
// Trigger retry for this event
....
}
{code}
First problem is that the TimeoutException is being thrown - according to ISPN-664 if the
fail silent flag was set, it shouldn't throw an exception. But also the zero ms
timeout flag is set, but as you will see from the logs, it is timing out after 10 seconds,
which is the parameter in the config file - so looks like the flags are being ignored?
As you will also see from the log, after the exception occurs, subsequent 'get'
operations fail due to an IllegalState exception on the transaction.
{code}
09:32:52,863 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (Thread-21
(group:HornetQ-client-global-threads-5114937)) ISPN000136: Execution error:
org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds]
on key [id-2401891321040471266] for requestor [GlobalTransaction:<null>:91:local]!
Lock held by [GlobalTransaction:<null>:81:local]
at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:207)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLockNoCheck(LockManagerImpl.java:190)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.locking.AbstractLockingInterceptor.lockKey(AbstractLockingInterceptor.java:111)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeysForLockCommand(AbstractTxLockingInterceptor.java:133)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.visitLockControlCommand(AbstractTxLockingInterceptor.java:118)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:142)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:154)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:142)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:181)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.TxInterceptor.visitLockControlCommand(TxInterceptor.java:137)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:142)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:154)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:142)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:104)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.InvocationContextInterceptor.visitLockControlCommand(InvocationContextInterceptor.java:69)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:142)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:318)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.CacheImpl.lock(CacheImpl.java:456)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.CacheImpl.lock(CacheImpl.java:443)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:145)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.savara.sam.ams.conversations.ConversationManager.processActivity(ConversationManager.java:187)
[activity-monitor-server.jar:]
at
org.savara.sam.ams.conversations.ConversationManager.processActivity(ConversationManager.java:45)
[activity-monitor-server.jar:]
at org.savara.sam.aqs.JEEActiveQueryManager.onMessage(JEEActiveQueryManager.java:310)
[active-query-server.jar:]
{code}
followed by
{code}
09:32:52,913 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (Thread-25
(group:HornetQ-client-global-threads-5114937)) ISPN000136: Execution error:
java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction:
0:ffffc0a80175:38b79c02:4ece0f24:16f status: ActionStatus.ABORT_ONLY > is not in a
valid state to be invoking cache operations on.
at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:205)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:177)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:172)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:84)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:104)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:64)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:90)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:318)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.CacheImpl.get(CacheImpl.java:260)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.CacheImpl.get(CacheImpl.java:252)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:250)
[infinispan-core-5.1.0.BETA2.jar:5.1.0.BETA2]
at
org.savara.sam.ams.conversations.ConversationManager.processActivity(ConversationManager.java:105)
[activity-monitor-server.jar:]
at
org.savara.sam.ams.conversations.ConversationManager.processActivity(ConversationManager.java:45)
[activity-monitor-server.jar:]
at org.savara.sam.aqs.JEEActiveQueryManager.onMessage(JEEActiveQueryManager.java:310)
[active-query-server.jar:]
{code}
Ability to test and acquire lock if available, without aborting the
txn if not available
----------------------------------------------------------------------------------------
Key: ISPN-1556
URL:
https://issues.jboss.org/browse/ISPN-1556
Project: Infinispan
Issue Type: Feature Request
Affects Versions: 5.1.0.BETA2
Environment: AS7.1.0.alpha2
Reporter: Gary Brown
Assignee: Manik Surtani
I have a system that performs a large number of tasks in a single transaction for
efficiency. Some of those tasks access infinispan caches.
I found that occasionally I have been getting lock timeouts for the default 15 second
period.
Lock contention is not a problem - but the impact of failing to obtain the lock results
in the whole transaction being aborted, which aborts the work also carried out for
potentially a large number of other tasks, resulting in all of the work being retried.
I was wondering if it would be possible to provide an alternative lock implementation the
AdvancedCache that allowed a client app to test whether the lock was available and acquire
it - returning 'true', but if the lock was not available, simply returning false,
allowing the client code to make a decision about how to proceed.
In my case, I could then add the specific task to a retry queue, and move onto the next
task, committing all of the work that had been successfully completed for the other tasks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira