[ 
https://forge.continuent.org/jira/browse/SEQUOIA-1110?page=comments#action_15049
 ] 

Stephane Giron commented on SEQUOIA-1110:
-----------------------------------------

The problem is just that this does not wait for the whole delay for the task to 
complete. In that case, the remaining value would be greater than 0, which 
would mean that nothing is logged about the timeout (moreover, we consider that 
the task failed whereas it could succeed in the remaining time).

This can lead to this kind of problems :
Commit of transaction 929 failed on controller Member(...) 
(java.sql.SQLException: No backend thread succeeded to commit transaction 929)
Request commit failed on all local backends but succeeded on other controllers. 
Disabling all local backends.

This kind of code shows the wait(timeout) problem :

Object test = new Object();
while(true)
{
synchronized(test)
{
long start = System.currentTimeMillis();
try
{
test.wait(10);
}
catch (InterruptedException e)
{
  // TODO Auto-generated catch block
  e.printStackTrace();
}
long end = System.currentTimeMillis();
long remaining = 10 - (end - start);
if(remaining > 0)
System.out.println("Only waited = " + (end-start));
}
}

When running, I got this output :

java test
Only waited = 9
Only waited = 6
Only waited = 9
Only waited = 4
Only waited = 6
Only waited = 6
Only waited = 4

My test does not do any spurious notify, just run the loop.

The interest of the fix :
- just be sure that we waited the whole duration, not only part of it
- have better logging : if the whole wait timeout is reached, then this would 
execute :
      if (remaining <= 0)
          {
            if (logger.isErrorEnabled())
              logger.error("Timed out while waiting for task " + task);
- avoid disabling a backend too early is also one of the goal

About MulticastResponse, this is the commit that fixed the problem :
Workaround for cases where Object.wait() returns too early. It does happen in 
rare occasions.
This is revision 1.2 committed by Damian on 6/14/2007
I was referring to the wait issue and to the fix that was done in order to be 
sure that either we waited the whole delay before  considering the task as 
failed or that the task succeeded.


> Error message "No backend thread succeeded to commit transaction" sometimes 
> shows in the log files
> --------------------------------------------------------------------------------------------------
>
>          Key: SEQUOIA-1110
>          URL: https://forge.continuent.org/jira/browse/SEQUOIA-1110
>      Project: Sequoia
>         Type: Bug

>   Components: Core
>     Versions: sequoia 2.10.10
>     Reporter: Stephane Giron
>     Assignee: Robert Hodges
>     Priority: Critical
>      Fix For: sequoia 2.10.11

>
>
> In this case, the CommitTask did not succeed (success=0) but the exceptions 
> List is null.
> SQLException while executing distributed commit 
> java.sql.SQLException: No backend thread succeeded to commit transaction 929 
>         at 
> org.continuent.sequoia.controller.loadbalancer.raidb1.RAIDb1.commit(RAIDb1.java:1320)
>  
>         at 
> org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedCommit.executeCommand(DistributedCommit.java:125)
>  
>         at 
> org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedTransactionMarker.handleMessageMultiThreaded(DistributedTr\
>  
> ansactionMarker.java:131) 
>         at 
> org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase.handleMessageMultiThreaded(DistributedVirtualDataba\
>  
> se.java:364) 
>         at 
> org.continuent.hedera.adapters.MulticastRequestAdapterThread.run(MulticastRequestAdapterThread.java:102

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to