[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2023-03-14 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17700409#comment-17700409
 ] 

Ekaterina Dimitrova edited comment on CASSANDRA-17850 at 3/14/23 10:40 PM:
---

{quote}At least with Java 9+ we should be able to use the new {{ProcessHandle}} 
API to get the PID
{quote}

Agreed, though this is not solution to the need to get FileDescriptor.fd and 
sun.nio.ch.FileChannelImpl.fd without opening internals which we try to tackle 
here. Even if we use the {{ProcessHandle}} API to get the PID we still need to 
open the internals to get fd. 



was (Author: e.dimitrova):
{quote}At least with Java 9+ we should be able to use the new {{ProcessHandle}} 
API to get the PID
{quote}

Agreed, though this is not solution to the need to get FileDescriptor.fd and 
sun.nio.ch.FileChannelImpl.fd without opening internals which we try to tackle 
here. Even if we use the {{ProcessHandle}} API we still need to open the 
internals for those. 


> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 5.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int java.io.FileDescriptor.fd accessible: module java.base does 
> not "opens java.io" to unnamed module @11d8ae8b
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
> at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:796)
> ... 20 common frames omitted
> {code}
> and 
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:31:18,443 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: 

[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2023-03-14 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17700409#comment-17700409
 ] 

Ekaterina Dimitrova edited comment on CASSANDRA-17850 at 3/14/23 10:40 PM:
---

{quote}At least with Java 9+ we should be able to use the new {{ProcessHandle}} 
API to get the PID
{quote}

Agreed, though this is not solution to the need to get FileDescriptor.fd and 
sun.nio.ch.FileChannelImpl.fd without opening internals which we try to tackle 
here. Even if we use the {{ProcessHandle}} API we still need to open the 
internals for those. 



was (Author: e.dimitrova):
{quote}At least with Java 9+ we should be able to use the new {{ProcessHandle}} 
API to get the PID
{quote}

Agreed, though this is not solution to the need to get FileDescriptor.fd and 
sun.nio.ch.FileChannelImpl.fd without opening internals which we try to tackle 
here. We still need to open the internals for those. 


> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 5.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int java.io.FileDescriptor.fd accessible: module java.base does 
> not "opens java.io" to unnamed module @11d8ae8b
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
> at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:796)
> ... 20 common frames omitted
> {code}
> and 
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:31:18,443 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private final 

[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2022-10-13 Thread Benedict Elliott Smith (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616836#comment-17616836
 ] 

Benedict Elliott Smith edited comment on CASSANDRA-17850 at 10/13/22 7:39 AM:
--

You can get them directly from {{{}FileInputStream{}}}, {{FileOutputStream}} 
and {{{}RandomAccessFile{}}}. It is a shame there is no equivalent method for 
{{{}FileChannel{}}}. There is also the option of redefining {{FileChannelImpl}} 
on load (using ASM) to introduce a public method to retrieve the 
{{FileDescriptor}} and to simply define our static accessor method (also using 
ASM) to access this public method.

But, it might be that we don't really need the file descriptor and can simply 
use the {{force}} method on {{{}FileChannel{}}}. We can even do this for 
syncing directories, seemingly. Relevant JDK bug thread where this feature was 
temporarily broken, tracking a replacement mechanism (that does not yet exist): 
[https://bugs.openjdk.org/browse/JDK-8080235]

 


was (Author: benedict):
You can get them directly from {{{}FileInputStream{}}}, {{FileOutputStream}} 
and {{{}RandomAccessFile{}}}. It is a shame there is no equivalent method for 
{{{}FileChannel{}}}. There is also the option of redefining {{FileChannelImpl}} 
on load to introduce a public method to retrieve the {{FileDescriptor}} and to 
simply define our static accessor method (also using ASM) to access this public 
method.

But, it might be that we don't really need the file descriptor and can simply 
use the {{force}} method on {{{}FileChannel{}}}. We can even do this for 
syncing directories, seemingly. Relevant JDK bug thread where this feature was 
temporarily broken, tracking a replacement mechanism (that does not yet exist): 
[https://bugs.openjdk.org/browse/JDK-8080235]

 

> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 4.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int 

[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2022-10-13 Thread Benedict Elliott Smith (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616836#comment-17616836
 ] 

Benedict Elliott Smith edited comment on CASSANDRA-17850 at 10/13/22 7:34 AM:
--

You can get them directly from {{{}FileInputStream{}}}, {{FileOutputStream}} 
and {{{}RandomAccessFile{}}}. It is a shame there is no equivalent method for 
{{{}FileChannel{}}}. There is also the option of redefining {{FileChannelImpl}} 
on load to introduce a public method to retrieve the {{FileDescriptor}} and to 
simply define our static accessor method (also using ASM) to access this public 
method.

But, it might be that we don't really need the file descriptor and can simply 
use the {{force}} method on {{{}FileChannel{}}}. We can even do this for 
syncing directories, seemingly. Relevant JDK bug thread where this feature was 
temporarily broken, tracking a replacement mechanism (that does not yet exist): 
[https://bugs.openjdk.org/browse/JDK-8080235]

 


was (Author: benedict):
You can get them from FileInputStream, FileOutputStream and RandomAccessFile.

But, it might be that we don't really need the file descriptor and can simply 
use the {{force}} method on {{{}FileChannel{}}}. We can even do this for 
syncing directories, seemingly. Relevant JDK bug thread where this feature was 
temporarily broken, tracking a replacement mechanism (that does not yet exist): 
[https://bugs.openjdk.org/browse/JDK-8080235]

 

> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 4.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int java.io.FileDescriptor.fd accessible: module java.base does 
> not "opens java.io" to unnamed module @11d8ae8b
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
> at 

[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2022-08-23 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17583800#comment-17583800
 ] 

Ekaterina Dimitrova edited comment on CASSANDRA-17850 at 8/23/22 6:41 PM:
--

So far I haven't found anyone using something different than the reflection 
option and complaining about it. Opening here as a place holder for further 
future investigations how to refactor this in Cassandra. Open for ideas too


was (Author: e.dimitrova):
So far I haven't found anyone using something different than the reflection 
option and complaining about it. Opening here as a place holder for further 
future investigations. Open for ideas too

> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 4.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int java.io.FileDescriptor.fd accessible: module java.base does 
> not "opens java.io" to unnamed module @11d8ae8b
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
> at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:796)
> ... 20 common frames omitted
> {code}
> and 
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:31:18,443 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private final java.io.FileDescriptor 
> sun.nio.ch.FileChannelImpl.fd accessible: module java.base does not "opens 
> sun.nio.ch" to unnamed module @4c012563
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at 

[jira] [Comment Edited] (CASSANDRA-17850) Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without opening internals

2022-08-23 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17583800#comment-17583800
 ] 

Ekaterina Dimitrova edited comment on CASSANDRA-17850 at 8/23/22 6:39 PM:
--

So far I haven't found anyone using something different than the reflection 
option and complaining about it. Opening here as a place holder for further 
future investigations. Open for ideas too


was (Author: e.dimitrova):
So far I haven't found anyone using something different than the reflection 
option and complaining about it. Opening here as a place holder for further 
future investigations. 

> Find a way to get FileDescriptor.fd and sun.nio.ch.FileChannelImpl.fd without 
> opening internals
> ---
>
> Key: CASSANDRA-17850
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17850
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Build
>Reporter: Ekaterina Dimitrova
>Priority: Normal
> Fix For: 4.x
>
>
> With Java 17 if we do not add below to the jvm17 server options:
> {code:java}
> --add-opens java.base/sun.nio.ch=ALL-UNNAMED
> --add-opens java.base/java.io=ALL-UNNAMED{code}
> we get on startup (considering I comment out the scripted UDFs and apply a 
> few changes to the startup scripts):
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:29:25,652 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private int java.io.FileDescriptor.fd accessible: module 
> java.base does not "opens java.io" to unnamed module @11d8ae8b
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:84)
> at org.apache.cassandra.utils.TimeUUID$Generator.hash(TimeUUID.java:496)
> at org.apache.cassandra.utils.TimeUUID$Generator.makeNode(TimeUUID.java:474)
> at 
> org.apache.cassandra.utils.TimeUUID$Generator.makeClockSeqAndNode(TimeUUID.java:452)
> at org.apache.cassandra.utils.TimeUUID$Generator.(TimeUUID.java:368)
> at 
> org.apache.cassandra.streaming.StreamingState.(StreamingState.java:50)
> at org.apache.cassandra.streaming.StreamManager.(StreamManager.java:257)
> at 
> org.apache.cassandra.streaming.StreamManager.(StreamManager.java:58)
> at org.apache.cassandra.service.StorageService.(StorageService.java:376)
> at 
> org.apache.cassandra.service.StorageService.(StorageService.java:226)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch.updateScores(DynamicEndpointSnitch.java:274)
> at 
> org.apache.cassandra.locator.DynamicEndpointSnitch$1.run(DynamicEndpointSnitch.java:91)
> at 
> org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at 
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> at java.base/java.lang.Thread.run(Thread.java:833)
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
> field private int java.io.FileDescriptor.fd accessible: module java.base does 
> not "opens java.io" to unnamed module @11d8ae8b
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
> at 
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
> at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:796)
> ... 20 common frames omitted
> {code}
> and 
> {code:java}
> ERROR [ScheduledTasks:1] 2022-08-23 12:31:18,443 
> JVMStabilityInspector.java:68 - Exception in thread 
> Thread[ScheduledTasks:1,5,ScheduledTasks]
> java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: 
> Unable to make field private final java.io.FileDescriptor 
> sun.nio.ch.FileChannelImpl.fd accessible: module java.base does not "opens 
> sun.nio.ch" to unnamed module @4c012563
> at 
> org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:801)
> at org.apache.cassandra.utils.NativeLibrary.(NativeLibrary.java:87)
> at