You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jackson Chung (JIRA)" <ji...@apache.org> on 2011/07/13 02:25:00 UTC

[jira] [Created] (CASSANDRA-2895) add java classpath to cassandra startup logging

add java classpath to cassandra startup logging
-----------------------------------------------

                 Key: CASSANDRA-2895
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
             Project: Cassandra
          Issue Type: Improvement
            Reporter: Jackson Chung
            Priority: Minor


this is helpful to determine/verify if the Cassandra is started with the expected classpath

it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Rick Shaw commented on CASSANDRA-2895:
--------------------------------------

This will only be logged once at startup. Why not just put:


{{echo "CLASSPATH      = " $CLASSPATH}}


after the definition of {{CLASSPATH}} in the "{{cassandra.in.sh}}" file in the {{/bin}} directory? 

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jackson Chung
>            Priority: Minor
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Hudson commented on CASSANDRA-2895:
-----------------------------------

Integrated in Cassandra-0.7 #536 (See [https://builds.apache.org/job/Cassandra-0.7/536/])
    log Java classpath on startup
patch by Jackson Chung; reviewed by jbellis for CASSANDRA-2895

jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151209
Files : 
* /cassandra/branches/cassandra-0.7/CHANGES.txt
* /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java


> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jackson Chung
>            Assignee: Jackson Chung
>            Priority: Minor
>             Fix For: 0.7.9, 0.8.2
>
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jonathan Ellis resolved CASSANDRA-2895.
---------------------------------------

    Resolution: Fixed

Jackson: Okay, I'll buy that.  Committed to 0.7.8, 0.8.3, and 1.0.

Rick: that relies on stdout being captured, which isn't always the case.  (And even when it is, I'd prefer to avoid having to explain why that's in a separate file than system.log...)

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jackson Chung
>            Assignee: Jackson Chung
>            Priority: Minor
>             Fix For: 0.8.2, 0.7.8
>
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jonathan Ellis updated CASSANDRA-2895:
--------------------------------------

    Fix Version/s:     (was: 0.7.8)
                   0.7.9

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jackson Chung
>            Assignee: Jackson Chung
>            Priority: Minor
>             Fix For: 0.7.9, 0.8.2
>
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jackson Chung commented on CASSANDRA-2895:
------------------------------------------

sure. First off, I will start by saying it is absolutely possible to still obtain the classpath from other techniques, such as jconsole, jinfo, ps, /proc/<pid>/cmdline, etc. All these are doable providing using it properly. Some common typical challenges on these "other techniques": PATH is difference for the user who starts cassandra vs user who ssh into the machine and check, resulting in cannot attach the jvm due to jvm mismatched. Cannot attach remotely due to permission. ps result truncated. /proc/<pid>cmdline result is ugly (no separator).

We need to know the classpath info to identify which jars contains the classes. Granted knowing "just" the classpath is not enough as one would still need to verify that actual path/jar exists (and with proper permission). Down the road when hotfixes accumulated (and for the sake of arguments in a scenario where the hotfix only contains fixed classes, but not the whole build), we would need to identify if a hotfix (jar) is properly set in the classpath to validate the java process is running with the hotfix.

a real (small) example: 
 INFO [main] 2011-07-22 11:34:10,113 CLibrary.java (line 61) JNA not found. Native methods will be disabled.

well from a end-user perspective, not found "where"? Of course a java-experienced user would most likely intuitively think of class path. But for others it may not be obvious. Further support analysts will need to do his/her own analysis to determine if the jna.jar is on the classpath and in the said-location. (ie jna.jar is in /path/to/ but classpath said /path/to/others/). This could be further challenged if it needs to be done remotely or the analyst has no direct access to the machine. 

Hence the classpath info is one of the more important info for someone who understand not just Cassandra, but java in general of what it is doing.

As to oppose using DEBUG: currently the logging does not have a "header" sets. Ie the log is logged once and wouldn't appear again. Logging at DEBUG for some that only logged once at startup means one would have to restart the jvm to see the log. That seems overkill for just simply get a log. One may as well learn/try to use jinfo/jconsole/ps/cmdline to get that info. 

I agree we wouldn't want every bit of details (that say available via jinfo) to be logged, that would noise the log quite a bit. On the other hand, the classpath itselfs provides a quick and strong validation to properly identify any misconfiguration on classpath settings. 

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jackson Chung
>            Priority: Minor
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jonathan Ellis updated CASSANDRA-2895:
--------------------------------------

         Reviewer: jbellis
      Component/s: Core
    Fix Version/s: 0.7.8
                   0.8.2
         Assignee: Jackson Chung

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jackson Chung
>            Assignee: Jackson Chung
>            Priority: Minor
>             Fix For: 0.7.8, 0.8.2
>
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jonathan Ellis commented on CASSANDRA-2895:
-------------------------------------------

INFO means "this is important for someone to understand what Cassandra is doing."  I don't think this meets that threshold.  Can you make the case for why this shouldn't be DEBUG?

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jackson Chung
>            Priority: Minor
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jackson Chung commented on CASSANDRA-2895:
------------------------------------------

svn diff ./src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java 
Index: src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
===================================================================
--- src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java  (revision 1147350)
+++ src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java  (working copy)
@@ -101,6 +101,7 @@
     {
        logger.info("JVM vendor/version: {}/{}", System.getProperty("java.vm.name"), System.getProperty("java.version") );
         logger.info("Heap size: {}/{}", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
+               logger.info("Classpath: {}", System.getProperty("java.class.path"));
        CLibrary.tryMlockall();
 
         listenPort = DatabaseDescriptor.getRpcPort();


{noformat}
 INFO [main] 2011-07-15 18:02:04,110 AbstractCassandraDaemon.java (line 104) Classpath: /home/jackson/work/cassandra-trunk/conf:/home/jackson/work/cassandra-trunk/build/classes/main:/home/jackson/work/cassandra-trunk/build/classes/thrift:/home/jackson/work/cassandra-trunk/lib/antlr-3.2.jar:/home/jackson/work/cassandra-trunk/lib/apache-cassandra-0.8.0-SNAPSHOT.jar:/home/jackson/work/cassandra-trunk/lib/apache-cassandra-cql-1.0.3.jar:/home/jackson/work/cassandra-trunk/lib/apache-cassandra-thrift-0.8.0-SNAPSHOT.jar:/home/jackson/work/cassandra-trunk/lib/avro-1.4.0-fixes.jar:/home/jackson/work/cassandra-trunk/lib/avro-1.4.0-sources-fixes.jar:/home/jackson/work/cassandra-trunk/lib/commons-cli-1.1.jar:/home/jackson/work/cassandra-trunk/lib/commons-codec-1.2.jar:/home/jackson/work/cassandra-trunk/lib/commons-lang-2.4.jar:/home/jackson/work/cassandra-trunk/lib/concurrentlinkedhashmap-lru-1.2.jar:/home/jackson/work/cassandra-trunk/lib/guava-r08.jar:/home/jackson/work/cassandra-trunk/lib/high-scale-lib-1.1.2.jar:/home/jackson/work/cassandra-trunk/lib/jackson-core-asl-1.4.0.jar:/home/jackson/work/cassandra-trunk/lib/jackson-mapper-asl-1.4.0.jar:/home/jackson/work/cassandra-trunk/lib/jamm-0.2.2.jar:/home/jackson/work/cassandra-trunk/lib/jline-0.9.94.jar:/home/jackson/work/cassandra-trunk/lib/jna.jar:/home/jackson/work/cassandra-trunk/lib/json-simple-1.1.jar:/home/jackson/work/cassandra-trunk/lib/libthrift-0.6.jar:/home/jackson/work/cassandra-trunk/lib/log4j-1.2.16.jar:/home/jackson/work/cassandra-trunk/lib/maven-ant-tasks-2.1.3.jar:/home/jackson/work/cassandra-trunk/lib/servlet-api-2.5-20081211.jar:/home/jackson/work/cassandra-trunk/lib/slf4j-api-1.6.1.jar:/home/jackson/work/cassandra-trunk/lib/slf4j-log4j12-1.6.1.jar:/home/jackson/work/cassandra-trunk/lib/snakeyaml-1.6.jar:/home/jackson/work/cassandra-trunk/lib/jamm-0.2.2.jar
{noformat}

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jackson Chung
>            Priority: Minor
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (CASSANDRA-2895) add java classpath to cassandra startup logging

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

Jackson Chung updated CASSANDRA-2895:
-------------------------------------

    Attachment: 2895.diff

trunk

> add java classpath to cassandra startup logging
> -----------------------------------------------
>
>                 Key: CASSANDRA-2895
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2895
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jackson Chung
>            Priority: Minor
>         Attachments: 2895.diff
>
>
> this is helpful to determine/verify if the Cassandra is started with the expected classpath
> it's a simple 1-liner addon that are useful... will submit a patch later.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira