redhat-developer / rsp-server-community

A repository for additions to rsp-server and the associated vscode extension to add support for other runtimes
31 stars 17 forks source link

Watchservice requires high sensitivity on this system #183

Open nunovieira opened 1 year ago

nunovieira commented 1 year ago

In VSCode, when Community Server Connector starts, the output shows many lines like:

17:30:35.171 [unch RSP Server] WARN o.j.t.r.s.f.FileWatcherService:206 - Watchservice requires high sensitivity on this system. Unfortunately it isn't present and thus watching the filesystem is unreliable. Please use openjdk or a sun jvm to allow us to use high sensitivity.

I believe it's using openjdk 11. What could be done to solve this?

robstryker commented 1 year ago

Can you list your operating system and other relevant details? Also it'd be good to verify what jdk it's actually using if possible.

nunovieira commented 1 year ago

macOS 13.2.1 with M1 Pro processor openjdk installed via homebrew (brew install openjdk@11 and sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk)

In VSCode settings:

    "rsp-ui.rsp.java.home": "/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home",

and the process is using that jdk:

  501 69876 69444   0 12:07   ??         0:09.98 /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home/bin/java -Drsp.server.port=9000 -Dorg.jboss.tools.rsp.id=redhat-community-server-connector -Dlogback.configurationFile=./conf/logback.xml -jar /Users/nuno/.vscode/extensions/redhat.vscode-community-server-connector-0.26.6/server/bin/felix.jar

I also have Zulu 8 installed, but doesn't look to be used here.

What more information do you need?

robstryker commented 1 year ago

There's not much you can do here. Openjdk does not have a watch service that responds to filesystem or operating system events at this time. The implementation is completely polling-based, and thus will be slower, and could potentially miss events if for example a delete-file and create-file both occur between poll events.

There's really not much I can do on my end to fix this. Writing a custom mac filewatcher service appears to be something that even openjdk is struggling with, so the odds that I can do better are very low ;)