This content has been marked as final.
Show 6 replies
-
1. Re: Write lock is not released
genman Jul 9, 2007 9:13 PM (in response to metastaz)What's the write thread doing? (Can you get a stack trace of your application at this time?)
-
2. Re: Write lock is not released
metastaz Jul 10, 2007 5:46 AM (in response to metastaz)"genman" wrote:
What's the write thread doing? (Can you get a stack trace of your application at this time?)
Yep that's a good idea. However I do not have exact steps to reproduce this issue, and we observe it only ocassionaly in production. I'll try to reproduce it and get the stack trace.
Thank you,
Stas. -
3. Re: Write lock is not released
metastaz Jul 10, 2007 11:27 AM (in response to metastaz)"genman" wrote:
What's the write thread doing? (Can you get a stack trace of your application at this time?)
Meanwhile, any other ideas? -
4. Re: Write lock is not released
manik Jul 10, 2007 12:13 PM (in response to metastaz)It looks like the current WL holder and the RL requestor are not the same:
... could not be acquired by <zzz:4256>:162303 ...
and... Write lock owner: Thread[ReportDataTaskRunner-20521017-1,5,jboss] ...
A thread dump would be very helpful.
In addition, what transaction manager (if any) have you configured for JBoss Cache (the TransactionManagerLookup attribute in your JBoss Cache cfg xml)? -
5. Re: Write lock is not released
metastaz Jul 10, 2007 1:07 PM (in response to metastaz)"manik.surtani@jboss.com" wrote:
It looks like the current WL holder and the RL requestor are not the same:... could not be acquired by <zzz:4256>:162303 ...
and... Write lock owner: Thread[ReportDataTaskRunner-20521017-1,5,jboss] ...
A thread dump would be very helpful.
In addition, what transaction manager (if any) have you configured for JBoss Cache (the TransactionManagerLookup attribute in your JBoss Cache cfg xml)?
Oh, I see first time thread acquired WL without GlobalTransaction but then it tries to get a RL having one.
As for TransactionManagerLookup - we have TransactionManagerLookupClass attribute set to org.jboss.cache.JBossTransactionManagerLookup
Thank you,
Stas. -
6. Re: Write lock is not released
vitamin-c Sep 6, 2007 8:34 AM (in response to metastaz)"manik.surtani@jboss.com" wrote:
It looks like the current WL holder and the RL requestor are not the same:... could not be acquired by <zzz:4256>:162303 ...
and... Write lock owner: Thread[ReportDataTaskRunner-20521017-1,5,jboss] ...
Is it OK that RL requestor thread uses a GlobalTransaction, whereas WL owner thread doesn't?
Here's the code, where a GlobalTransaction is assigned to a thread requesting a lock (either RL or WL):package org.jboss.cache.interceptors; ... public class LockInterceptor extends Interceptor { ... public Object invoke(MethodCall m) throws Throwable { ... GlobalTransaction gtx=null; ... if(tx_mgr != null && (tx=tx_mgr.getTransaction()) != null && isValid(tx)) { // ACTIVE or PREPARING if(!transactions.contains(tx)) { gtx=cache.getCurrentTransaction(tx); if(gtx == null) throw new Exception("failed to get global transaction"); ... else { gtx=cache.getTransactionTable().get(tx); } ...
Assuming that transaction manager presents, it is still unclear will a thread receive a non-null gtx, since cache.getTransactionTable().get(tx) doesn't check for null return value. According to metastaz's observations a thread may or may not receive a gtx, which looks like a bug, doesn't it?
Thanks,
Alexey