You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Vikram Bhatia (JIRA)" <ji...@apache.org> on 2007/04/27 22:52:15 UTC

[jira] Created: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
-------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-230
                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 0.9.6, 0.9.0, 0.9.7
            Reporter: Vikram Bhatia
            Priority: Minor


When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492416 ] 

Vikram Bhatia commented on OPENJPA-230:
---------------------------------------

I tried this too, but what will happen in case thread is already in wait() state, and there are no more packets. join() will keep on waiting forever and process will never exit.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, OPENJPA-230.patch, reproducer.zip, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikram Bhatia updated OPENJPA-230:
----------------------------------

    Attachment: soln.diff

Proposed Solution.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikram Bhatia updated OPENJPA-230:
----------------------------------

    Attachment: testcase.zip

JUnit testcase.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, OPENJPA-230.patch, reproducer.zip, soln.diff, testcase.zip
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikram Bhatia updated OPENJPA-230:
----------------------------------

    Attachment: reproducer.zip

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, reproducer.zip, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492398 ] 

Vikram Bhatia commented on OPENJPA-230:
---------------------------------------

Well I have though about it, but it fails the following scenario.

1. Four Threads running and eight Packets in queue. The four threads are busy sending packets.
3. In case, _keepRunning is set to false, four packets will still be left to synchronize as threads exit from while loop.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492413 ] 

Vikram Bhatia commented on OPENJPA-230:
---------------------------------------

It works based on size of the packet queue. Once the broadcast queue is empty, it interrupts the thread assuming that all the packets are broadcasted.

Why do _processLock is required?
It may call interrupt even if the thread is calling sendUpdateQueue if we dont have a syncronization. I was thinking about having boolean variable, but that will have synchronization issues, and thread may be interrupted without completely sending the packet.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, OPENJPA-230.patch, reproducer.zip, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-230:
------------------------------------

    Attachment: OPENJPA-230.patch

It'd be nice to not have to synchronize. What about if we made the threads non-daemon, and just call setRunning(false) instead? See attached (completely-untested) patch.

Also, I think that that boolean should be volatile to ensure thread-safety.

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-230:
------------------------------------

    Attachment: OPENJPA-230.patch

Good point -- _keepRunning is a bit too abrupt.

How does this work?

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>         Attachments: OPENJPA-230.patch, OPENJPA-230.patch, reproducer.zip, soln.diff
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-230) Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider

Posted by "Vikram Bhatia (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikram Bhatia resolved OPENJPA-230.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.8

The issue is resolved. Thanks

> Handle guaranteed delivery of Data Cache events on normal JVM termination using TCPRemoteCommitProvider
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-230
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-230
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Vikram Bhatia
>            Priority: Minor
>             Fix For: 0.9.8
>
>         Attachments: OPENJPA-230.patch, OPENJPA-230.patch, reproducer.zip, soln.diff, testcase.zip
>
>
> When an application is commiting a transaction and then terminating, often not all events regarding Data Cache are dispatched by the TCPRemoteCommitProvider. It seems that the JVM on termination is not waiting until TCPRemoteCommitProvider has dispatched all events regarding Data Cache. In this way some cache synchronization is lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.