cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Brown (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-14757) GCInspector "Error accessing field of java.nio.Bits" under java11
Date Tue, 18 Sep 2018 12:52:00 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-14757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Brown updated CASSANDRA-14757:
------------------------------------
    Description: 
Running under java11, {{GCInspector}} throws the following exception:
{noformat}
DEBUG [main] 2018-09-18 05:18:25,905 GCInspector.java:78 - Error accessing field of java.nio.Bits
java.lang.NoSuchFieldException: totalCapacity
        at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
        at org.apache.cassandra.service.GCInspector.<clinit>(GCInspector.java:72)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:308)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:590)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:679)
{noformat}
This is because {{GCInspector}} uses reflection to read the {{totalCapacity}} from {{java.nio.Bits}}.
This field was renamed to {{TOTAL_CAPACITY}} somewhere between java8 and java11.

Note: this is a rather harmless error, as we only look at {{Bits.totalCapacity}} for metrics
collection on how much direct memory is being used by {{ByteBuffer}}s. If we fail to read
the field, we simply return -1 for the metric value.

  was:
Running under java11, {{GCInspector}} throws the following exception:

{noformat}
DEBUG [main] 2018-09-18 05:18:25,905 GCInspector.java:78 - Error accessing field of java.nio.Bits
java.lang.NoSuchFieldException: totalCapacity
        at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
        at org.apache.cassandra.service.GCInspector.<clinit>(GCInspector.java:72)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:308)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:590)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:679)
{noformat}

This is because {{GCInspector}} uses reflection to read the {{totalCapacity}} from {{java.nio.Bits}}.
This field was renamed to {{TOTAL_CAPACITY}} somewhere between java8 and java11.


> GCInspector "Error accessing field of java.nio.Bits" under java11
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-14757
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14757
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Metrics
>            Reporter: Jason Brown
>            Priority: Trivial
>              Labels: Java11
>             Fix For: 4.0
>
>
> Running under java11, {{GCInspector}} throws the following exception:
> {noformat}
> DEBUG [main] 2018-09-18 05:18:25,905 GCInspector.java:78 - Error accessing field of java.nio.Bits
> java.lang.NoSuchFieldException: totalCapacity
>         at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
>         at org.apache.cassandra.service.GCInspector.<clinit>(GCInspector.java:72)
>         at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:308)
>         at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:590)
>         at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:679)
> {noformat}
> This is because {{GCInspector}} uses reflection to read the {{totalCapacity}} from {{java.nio.Bits}}.
This field was renamed to {{TOTAL_CAPACITY}} somewhere between java8 and java11.
> Note: this is a rather harmless error, as we only look at {{Bits.totalCapacity}} for
metrics collection on how much direct memory is being used by {{ByteBuffer}}s. If we fail
to read the field, we simply return -1 for the metric value.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message