You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tephra.apache.org by poornachandra <gi...@git.apache.org> on 2018/04/26 00:12:16 UTC

[GitHub] incubator-tephra pull request #72: TEPHRA-270 TEPHRA-271 Transaction state c...

GitHub user poornachandra opened a pull request:

    https://github.com/apache/incubator-tephra/pull/72

     TEPHRA-270  TEPHRA-271 Transaction state cache bug fixes 

    JIRA: https://issues.apache.org/jira/browse/TEPHRA-270
    https://issues.apache.org/jira/browse/TEPHRA-271
    
    This PR contains a couple of bug fixes for the Transaction state cache to fix race conditions and deadlocks.


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

    $ git pull https://github.com/poornachandra/incubator-tephra feature/tx-state-cache

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

    https://github.com/apache/incubator-tephra/pull/72.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 #72
    
----
commit 73feed9a6a93d032c2e19e4e7d77fa4eb2065fcf
Author: poorna <po...@...>
Date:   2018-04-25T23:51:56Z

    TEPHRA-270 Do not refresh the transaction state during co-processor startup to prevent deadlocks

commit d42b282ec03c8e0d07bbb2a714961f2dd9b7641d
Author: poorna <po...@...>
Date:   2018-04-25T23:58:22Z

    TEPHRA-271 Wait for the refresh thread to stop during shutdown to prevent race conditions

----


---

[GitHub] incubator-tephra pull request #72: TEPHRA-270 TEPHRA-271 Transaction state c...

Posted by anew <gi...@git.apache.org>.
Github user anew commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/72#discussion_r185303754
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/coprocessor/TransactionStateCache.java ---
    @@ -78,6 +78,7 @@ protected void startUp() throws Exception {
       protected void shutDown() throws Exception {
         if (refreshService != null) {
           refreshService.interrupt();
    +      refreshService.join(1000);
    --- End diff --
    
    I was mistaken, thinking that it would throw if the timeout is exceeded. Anyway, in a shutdown sequence we should catch all exceptions and ensure to continue the shutdown. 


---

[GitHub] incubator-tephra pull request #72: TEPHRA-270 TEPHRA-271 Transaction state c...

Posted by poornachandra <gi...@git.apache.org>.
Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/72#discussion_r185069321
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/coprocessor/TransactionStateCache.java ---
    @@ -78,6 +78,7 @@ protected void startUp() throws Exception {
       protected void shutDown() throws Exception {
         if (refreshService != null) {
           refreshService.interrupt();
    +      refreshService.join(1000);
    --- End diff --
    
    `Thread.join(long millis)` does not throw an exception on timeout being reached. It only throws `IllegalArgumentException` when timeout is negative or `InterruptedException`.
    
    Are you talking about handling the `InterruptedException`?


---

[GitHub] incubator-tephra pull request #72: TEPHRA-270 TEPHRA-271 Transaction state c...

Posted by anew <gi...@git.apache.org>.
Github user anew commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/72#discussion_r184323707
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/coprocessor/TransactionStateCache.java ---
    @@ -78,6 +78,7 @@ protected void startUp() throws Exception {
       protected void shutDown() throws Exception {
         if (refreshService != null) {
           refreshService.interrupt();
    +      refreshService.join(1000);
    --- End diff --
    
    this means, if the refreshService does not finish within a second, shutdown() will throw exception? And the remainder of the shutdown sequence is not performed? Is that intentional?


---

[GitHub] incubator-tephra pull request #72: TEPHRA-270 TEPHRA-271 Transaction state c...

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

    https://github.com/apache/incubator-tephra/pull/72


---