question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KQueue NativeIoException when profiling with JFR

See original GitHub issue

Expected behavior

The following behavior is puzzling me to even look where to start debugging.

When using a combination Kqueue event loops and running a JFR recording on the running program, suddenly this error appears:

Apr 05, 2019 8:12:30 AM com.couchbase.client.core.deps.io.netty.channel.kqueue.KQueueEventLoop handleLoopException
WARNING: Unexpected exception in the selector loop.
com.couchbase.client.core.deps.io.netty.channel.unix.Errors$NativeIoException: kevent(..) failed: Invalid argument
	at com.couchbase.client.core.deps.io.netty.channel.unix.Errors.newIOException(Errors.java:122)
	at com.couchbase.client.core.deps.io.netty.channel.kqueue.Native.keventWait(Native.java:97)
	at com.couchbase.client.core.deps.io.netty.channel.kqueue.KQueueEventLoop.kqueueWait(KQueueEventLoop.java:147)
	at com.couchbase.client.core.deps.io.netty.channel.kqueue.KQueueEventLoop.kqueueWait(KQueueEventLoop.java:139)
	at com.couchbase.client.core.deps.io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:208)
	at com.couchbase.client.core.deps.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
	at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

The interesting piece is I can start my workload fine and it runs for minutes, but as soon as I start a JFR this error pops up in the logs and doesn’t go away. Any idea what JFR does that could trip up the Kqueue implementation?

Actual behavior

No exception?

Netty version

4.1.34.Final

JVM version (e.g. java -version)

openjdk version “11.0.2” 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

OS version (e.g. uname -a)

(OSX Mojave 10.14.4) Darwin 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
normanmaurercommented, Apr 9, 2019

it basically interrupts from time to time the native call which then produces the EINTR

0reactions
normanmaurercommented, Apr 10, 2019

Also I have an idea for an unit test… working on it as we speak

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Troubleshoot Performance Issues Using JFR
The Java Flight Recorder is a great tool to investigate performance issues. No other tool gives as much profiling data without skewing the...
Read more >
Real-time profiling for Java using JFR metrics
APM for Java: Real-time Java profiling using Java Flight Recorder (JFR) metrics.
Read more >
Hunting down code hotspots with JDK Flight Recorder - BellSoft
JDK Flight Recorder (JFR) and Mission Control (MC) are free and open source performance/profiling products available with OpenJDK 11.
Read more >
Java Profiler for Azure Monitor Application Insights
The Application Insights Java profiler uses the JFR profiler provided by the JVM to record profiling data, allowing users to download the ...
Read more >
Using Java Flight Recorder and Mission Control (Part 1) - Foojay
jcmd provides a help command that describes documents for each command options. $ jcmd $(pgrep java) JFR.start \ name=app-profile \ duration= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found