You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by bayern39 <gi...@git.apache.org> on 2016/06/23 07:09:58 UTC

[GitHub] activemq-artemis pull request #595: [ARTEMIS-591] Wrong XAException return c...

GitHub user bayern39 opened a pull request:

    https://github.com/apache/activemq-artemis/pull/595

    [ARTEMIS-591] Wrong XAException return code when broker timeout is hit

    https://issues.apache.org/jira/browse/ARTEMIS-591

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bayern39/activemq-artemis ARTEMIS-591-dev

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/595.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #595
    
----
commit 40e89781eadb529159ee8529d45ecbda2fc9a45e
Author: bayern39 <mc...@redhat.com>
Date:   2016-06-23T07:06:06Z

    [ARTEMIS-591] Wrong XAException return code when broker timeout is hit

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @jbertram  OK,i will do it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @bayern39 look at https://github.com/apache/activemq-artemis/pull/722 please, where I'm addressing the typos


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @clebertsuconic  hi,at present,it scans for old transactions and rollback any it finds in RM,in the method    
    "tx.hasTimedOut(now, defaultTimeoutSeconds)",i think it is not only scanning for defaultTimeout transactions,but  also has hi the timeout on the TX,because we can see the implementation of "hasTimedOut" ,if we had set the timeout of the TX,it would be hit in the ResourceManager.
    
    `public boolean hasTimedOut(final long currentTime, final int defaultTimeout) {
          synchronized (timeoutLock) {
             boolean timedout;
             if (timeoutSeconds == -1) {
                timedout = getState() != Transaction.State.PREPARED && currentTime > createTime + defaultTimeout * 1000;
             }
             else {
                timedout = getState() != Transaction.State.PREPARED && currentTime > createTime + timeoutSeconds * 1000;
             }
    
             if (timedout) {
                markAsRollbackOnly(new ActiveMQException("TX Timeout"));
             }
    
             return timedout;
          }
       }
    `


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    This fix is not valid anyways. There's no way to determine if the server has hit the timeout on the TX yet. It would all depend on the scanning at the server's.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @bayern39  I merged this with an extra commit, with some changes I have made.. if you could review please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @clebertsuconic  OK,I will do it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @bayern39  ^^



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @clebertsuconic  yeah,as your say,at present ,RM scans  for old transactions and rollback any it finds,it is for global transactions.so i must add the judgement for local transation of itself timeout in RM,other than defaultimeout ,is it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    Can you add a test to your commit which verifies the proper exception code is returned in the case of a timeout?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    There's no way to determine here if the Rolledback was caused by a timed out.. or something else (like an error or something).
    
    I had been involved on tests where I was dealing with errors during load. And I don't see how to distinguish between an error and a time out.
    
    
    I'm also not sure what's the risk of


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @clebertsuconic  Hi Clebert,as we know ,we use  the server scanning find the time out  tx,this is the solution to determine the server hit time out,So I can not understand your means as well,can you tell me more details?Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #595: [ARTEMIS-591] Wrong XAException return c...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/595


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #595: [ARTEMIS-591] Wrong XAException return code whe...

Posted by bayern39 <gi...@git.apache.org>.
Github user bayern39 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/595
  
    @clebertsuconic  Hi clebert, i have considered your comment,what do you mean is that the RM can only   find the old transactions whose lifetime are older than the default transaction timeout by means of scanning the started transactions every transaction-timeout-scan-period time,so it can not find the time out transactions whose privacy attribute of  timeout  is not default transaction timeout in server and smaller than  default transaction timeout. So when the smaller time out transaction is over, the server can not find it  immediately ,it must await the RM scans it.Right? 
    
    I have communicated with the origin issue reporter,the reason why he posed the issue is not as a trouble of specific Artemis behavior,the issue is about asking for Artemis being better compliant with XA specification in error code.So i am considering whether it is needed to change the  Artemis behavior , because the present solution seems have not influence.We can still configure the  transaction-timeout-scan-period  with small value to cope with self-defined timeout attribute.This is my point, maybe have some mistakes,What do you think about it? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---