You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Peter Schuller (Created) (JIRA)" <ji...@apache.org> on 2012/01/27 07:39:38 UTC

[jira] [Created] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

StorageProxy static initialization not triggered until thrift requests come in
------------------------------------------------------------------------------

                 Key: CASSANDRA-3797
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
             Project: Cassandra
          Issue Type: Bug
            Reporter: Peter Schuller
            Assignee: Peter Schuller
            Priority: Minor


While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.

Effects:

* StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
* And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic


--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13195011#comment-13195011 ] 

Peter Schuller commented on CASSANDRA-3797:
-------------------------------------------

Really? That's strange. I just re-tried again to double-check (ant clean and everything) and the patch seems to make a difference here.

In the case of Class.forName() I cannot believe that is not supposed to be guaranteed. Are you *sure* it's not working? I would have to assume static initialization must by definition happen for Class.forName() to fullfil its contract (even if I could possibly buy slightly more easily that the staticallyInitialize() NOOP didn't, but even that seems like a stretch).

I am just building and {{./bin/cassandra -f}} and immediately attaching with visualvm.
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217491#comment-13217491 ] 

Peter Schuller commented on CASSANDRA-3797:
-------------------------------------------

Looks like {{3797-forname.txt}} is the same file as the original patch. In any case, suppose we just go for Class.forName() to avoid introducing that annoying method, and assuming it makes the metrics from CASSANDRA-3671, can I get a +1?
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3797:
--------------------------------------

    Attachment: 3797-forname-this-time-for-sure.txt

correct forname patch attached.

figured out my problem from last time: I was looking for StorageProxy under the old location in o.a.c.service, instead of o.a.c.db.  It appears correctly on startup in o.a.c.db with this patch.
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: 3797-forname-this-time-for-sure.txt, 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3797:
--------------------------------------

    Attachment: 3797-forname.txt

Hmm.  Neither this nor the forName approach (attached) is sufficient to o.a.c.service.StorageProxy show up in jconsole for me.
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] [Issue Comment Edited] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Peter Schuller (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217491#comment-13217491 ] 

Peter Schuller edited comment on CASSANDRA-3797 at 2/27/12 8:09 PM:
--------------------------------------------------------------------

Looks like {{3797-forname.txt}} is the same file as the original patch. In any case, suppose we just go for Class.forName() to avoid introducing that annoying method, and assuming it makes the metrics from CASSANDRA-3671 work, can I get a +1?
                
      was (Author: scode):
    Looks like {{3797-forname.txt}} is the same file as the original patch. In any case, suppose we just go for Class.forName() to avoid introducing that annoying method, and assuming it makes the metrics from CASSANDRA-3671, can I get a +1?
                  
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Brandon Williams (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217580#comment-13217580 ] 

Brandon Williams commented on CASSANDRA-3797:
---------------------------------------------

I tested this with CASSANDRA-3671 and everything worked.
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: 3797-forname.txt, CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Peter Schuller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Schuller updated CASSANDRA-3797:
--------------------------------------

    Attachment: CASSANDRA-3797-trunk-v1.txt

Attaching patch that has StorageService call a NOOP method on StorageProxy during start-up if not in client mode.

This feels unclean to me, but barring a "bigger" change to avoid the subtle static initialization order problem properly it was the easiest/cleanest fix I could think of.
                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>         Attachments: CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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] (CASSANDRA-3797) StorageProxy static initialization not triggered until thrift requests come in

Posted by "Peter Schuller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194531#comment-13194531 ] 

Peter Schuller commented on CASSANDRA-3797:
-------------------------------------------

Maybe a Class.forName() is cleaner (a Class klass = StorageProxy.class does not (necessarily) cause it to be loaded).

                
> StorageProxy static initialization not triggered until thrift requests come in
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3797
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3797
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Peter Schuller
>            Assignee: Peter Schuller
>            Priority: Minor
>         Attachments: CASSANDRA-3797-trunk-v1.txt
>
>
> While plugging in the metrics library for CASSANDRA-3671 I realized (because the metrics library was trying to add a shutdown hook on metric creation) that starting cassandra and simply shutting it down, causes StorageProxy to not be initialized until the drain shutdown hook.
> Effects:
> * StorageProxy mbean missing in visualvm/jconsole after initial startup (seriously, I thought I was going nuts ;))
> * And in general anything that makes assumptions about running early, or at least not during JVM shutdown, such as the metrics library, will be problematic

--
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