You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2012/07/09 08:45:34 UTC

[jira] [Created] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Sijie Guo created BOOKKEEPER-330:
------------------------------------

             Summary: System.currentTimeMillis usage in Hedwig
                 Key: BOOKKEEPER-330
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
             Project: Bookkeeper
          Issue Type: Bug
          Components: hedwig-server
    Affects Versions: 4.1.0, 4.0.0
            Reporter: Sijie Guo
             Fix For: 4.2.0


Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423030#comment-13423030 ] 

Hudson commented on BOOKKEEPER-330:
-----------------------------------

Integrated in bookkeeper-trunk #620 (See [https://builds.apache.org/job/bookkeeper-trunk/620/])
    BOOKKEEPER-330: System.currentTimeMillis usage in Hedwig (uma via sijie) (Revision 1365873)

     Result = UNSTABLE
sijie : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/benchmark/BenchmarkPublisher.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/benchmark/BenchmarkSubscriber.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/benchmark/BenchmarkUtils.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigClientImpl.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigSubscriber.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/admin/console/HedwigConsole.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/AbstractBenchmark.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookieBenchmark.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookkeeperBenchmark.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/delivery/FIFODeliveryManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/handlers/PublishHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/handlers/SubscribeHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/handlers/UnsubscribeHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/netty/ServerStats.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/persistence/ReadAheadCache.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestServerStats.java

                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422068#comment-13422068 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-330:
------------------------------------------------

Thanks a lot, Mridul for taking a look. 
Yep. we did not assume that switching to nanoTime will completely resolve the issue. That is the reason why we added nagative check for latency in the patch where we have faced the problem. Going like better than other one.
{code}
 if (latency < 0) {
{code}
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422875#comment-13422875 ] 

Sijie Guo commented on BOOKKEEPER-330:
--------------------------------------

committed as r1365875 in 4.1 branch.
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422015#comment-13422015 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-330:
------------------------------------------------

Yes, I have seen that backward times in multicore machines in both the cases (CurrentTimeMillis and nanoTime). Also added the same comment in BK-327 as well.
I think we should not completely depend on this system times for sensitive opretaions like array access ..etc. This patch adds the check for negative on latency because there will be chance for backward times in all the cases. counter based time calculation would be better than currentTimeMillis. But I am not sure the change you are proposing here will be really required. 
You mean, we will calculate all the time diffs with currentMillis, nanoTime and average out the elapsed time? That may messup the things I feel. Because always there may inaccuracy in times due to the mismatches in currentMillis and nanoTime right. Please correct me, If I understand your point wrongly.
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated BOOKKEEPER-330:
-------------------------------------------

    Attachment: BOOKKEEPER-330.patch
    
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G reassigned BOOKKEEPER-330:
----------------------------------------------

    Assignee: Uma Maheswara Rao G
    
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Mridul Muralidharan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422062#comment-13422062 ] 

Mridul Muralidharan commented on BOOKKEEPER-330:
------------------------------------------------

No, my point was changing from one api to another in the assumption that the bug will be resolved is misplaced - the same issues will recur (in a more unpredictable manner) with nanotime too ...

                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417666#comment-13417666 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-330:
------------------------------------------------

Updated a simple patch reflecting to BK-327.
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422852#comment-13422852 ] 

Sijie Guo commented on BOOKKEEPER-330:
--------------------------------------

the patch looks good to me. +1 


                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Mridul Muralidharan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417686#comment-13417686 ] 

Mridul Muralidharan commented on BOOKKEEPER-330:
------------------------------------------------

I should have raised the note in BOOKKEEPER-327.
In multi-core (and/or) multi-processor machines (particularly which are running for long) this method is practically useless for fine measurement.
The precision ('fine') depends on a variety of factors I guess.

System.currentTimeMillis() is at lower resolution (and with time jumps, via ntp updates, clock skew, etc) - but the measured difference would be what the system 'thought' the time difference was : should average out to the same (unless the nodes clock is chronically loosing time).
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-330.patch
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-330) System.currentTimeMillis usage in Hedwig

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409224#comment-13409224 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-330:
------------------------------------------------

I am not familiar in hedwig code, I will try to change in hedwig part also as the changes are straightforward.
Sijie, is there for review :-).
                
> System.currentTimeMillis usage in Hedwig
> ----------------------------------------
>
>                 Key: BOOKKEEPER-330
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-330
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: hedwig-server
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0
>
>
> Need same changes in hedwig server as what did in bookkeeper as BOOKKEEPER-327.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira