You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Erik Onnen (JIRA)" <ji...@apache.org> on 2010/11/18 22:59:39 UTC

[jira] Created: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
--------------------------------------------------------------------------------------------------------------------------------

                 Key: CASSANDRA-1756
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 0.7.0
            Reporter: Erik Onnen
             Fix For: 0.7.0


In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.

I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.

All tests pass with this change locally.

I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.

I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.


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


[jira] Commented: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933804#action_12933804 ] 

Gary Dusbabek commented on CASSANDRA-1756:
------------------------------------------

That patch does fix the circular reference but exposes other problems in the fat client.  I've attached a test case that never finishes.  I suspect over time we've introduced changes that couple a few of the singleton services together in undesirable ways.  

I'll spend some time looking at it this morning and see if I can make sense of it.

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v0-0001-test-that-blocks.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Commented: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

Posted by "Erik Onnen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933597#action_12933597 ] 

Erik Onnen commented on CASSANDRA-1756:
---------------------------------------

I forgot to add the stack trace resulting in the NPE in the original bug, sorry about that.

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.apache.cassandra.service.StorageService.<clinit>(StorageService.java:199)
	at io.eao.cassandra.http.Main.main(Main.java:24)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
	at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:396)
	... 2 more
Caused by: java.lang.NullPointerException
	at org.apache.cassandra.locator.DynamicEndpointSnitch.<init>(DynamicEndpointSnitch.java:74)
	at org.apache.cassandra.config.DatabaseDescriptor.createEndpointSnitch(DatabaseDescriptor.java:403)
	at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:275)

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Commented: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933820#action_12933820 ] 

Gary Dusbabek commented on CASSANDRA-1756:
------------------------------------------

0001 is Erik's patch
0002 is a test case that exposes an bug in the assumption DynamicEndpointSnitch makes about service initialization.
0003 fixes the bug.

Here is the chain of events.
StorageService.initClient() triggers static initializer in DD which instantiates a DynamicEndpointSnitch.  DES, as part of it's constructors schedule some tasks with SS.scheduledTasks which promptly starts executing them.  This causes MessagingService to initialize out of order which tries to access the not-fully-initialized SS, causing deadlock.  

SS cannot finish initializing until MS is done initializing, but MS is waiting on SS to do the same thing, near as I can tell.

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt, v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt, v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Commented: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Hudson commented on CASSANDRA-1756:
-----------------------------------

Integrated in Cassandra-0.7 #19 (See [https://hudson.apache.org/hudson/job/Cassandra-0.7/19/])
    

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt, v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt, v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek updated CASSANDRA-1756:
-------------------------------------

    Attachment: v0-0001-test-that-blocks.txt

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v0-0001-test-that-blocks.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Erik Onnen updated CASSANDRA-1756:
----------------------------------

    Priority: Minor  (was: Major)

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek updated CASSANDRA-1756:
-------------------------------------

    Attachment:     (was: v0-0001-StorageService.initClient-unit-test-that-never-finishe.txt)

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt, v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt, v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Assigned: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek reassigned CASSANDRA-1756:
----------------------------------------

    Assignee: Gary Dusbabek

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v0-0001-test-that-blocks.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek updated CASSANDRA-1756:
-------------------------------------

    Attachment: v0-0001-StorageService.initClient-unit-test-that-never-finishe.txt

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v0-0001-StorageService.initClient-unit-test-that-never-finishe.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Erik Onnen updated CASSANDRA-1756:
----------------------------------

    Attachment: CS-1756

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>             Fix For: 0.7.0
>
>         Attachments: CS-1756
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Commented: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933821#action_12933821 ] 

Jonathan Ellis commented on CASSANDRA-1756:
-------------------------------------------

+1

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt, v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt, v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek updated CASSANDRA-1756:
-------------------------------------

    Attachment:     (was: v0-0001-test-that-blocks.txt)

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v0-0001-StorageService.initClient-unit-test-that-never-finishe.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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


[jira] Updated: (CASSANDRA-1756) DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

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

Gary Dusbabek updated CASSANDRA-1756:
-------------------------------------

    Attachment: v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
                v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt
                v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt

> DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1756
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Erik Onnen
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.7.0
>
>         Attachments: CS-1756, v1-0001-fix-cicular-initialization-problem-between-StorageServ.txt, v1-0002-StorageService.initClient-unit-test-that-never-finishe.txt, v1-0003-DynamicEndpointSnitch-shouldn-t-update-if-SS-isn-t-ini.txt
>
>
> In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.
> I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.
> All tests pass with this change locally.
> I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.
> I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

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