Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to instantiate ServerSocket themselves #14

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

alexarchambault
Copy link

@alexarchambault alexarchambault commented Nov 22, 2021

This PR allows users to pass their own java.net.ServerSocket instance for domain sockets, rather than letting nailgun build it with its NGUnixDomainServerSocket and NGWin32NamedPipeServerSocket classes.

The should allow Bloop to get its ServerSocket instance via libdaemon-jvm, that

  • can build those instances via JDK 16 native support for domain sockets, which should be more reliable than using JNA
  • ensures such a server socket is created and listened on by only one process at a time, relying on file locks, among others, to do so.

(Feel free to either merge right now, or wait for the upcoming Bloop PR that relies on this.)

So that they can they can use Java 16 Unix domain socket support if they
want to.
@alexarchambault
Copy link
Author

cc @tgodzik

@tgodzik
Copy link

tgodzik commented Nov 23, 2021

I think these changes look sensible, we should merge it (I think I should have the rights now, but you might need to make it ready to review)

btw. @alexarchambault do you think we could upstream the changes here to the main fork of nailgun? I haven't looked too much into this fork, but it would be awesome to get rid of it.

@alexarchambault alexarchambault marked this pull request as ready for review November 25, 2021 17:00
@alexarchambault
Copy link
Author

@tgodzik Let's merge if it's fine then. Not sure if that's published once it's merged though, it seems there's no CI any more :/

@alexarchambault
Copy link
Author

About upstreaming the changes here, I'm not really sure. It seems the changes revolve around:

@alexarchambault
Copy link
Author

About the logging-related changes, I'm inclined to think these are unnecessary… Bloop could just configure java.util.logging on its own, rather than switching the codebase here to slf4j. If we really want logging messages via slf4j, we can always use a java-util-logging-to-slf4j bridge. But it seems Bloop disables those messages altogether via slf4j-nop, so we might as well just disable them by configuring java.util.logging (can even be done via some API calls IIRC).

@alexarchambault
Copy link
Author

That leaves:

  • extra NGServer constructors for custome stdin / stdout / stderr (no idea if that would be welcomed upstream)
  • security manager stuff (maybe we could insist in Overhead of SecurityManager facebookarchive/nailgun#134)
  • custom ServerSocket instance (this PR, no idea if that would be welcomed upstream either)

@tgodzik
Copy link

tgodzik commented Nov 25, 2021

That leaves:

  • extra NGServer constructors for custome stdin / stdout / stderr (no idea if that would be welcomed upstream)
  • security manager stuff (maybe we could insist in Overhead of SecurityManager facebook/nailgun#134)
  • custom ServerSocket instance (this PR, no idea if that would be welcomed upstream either)

From what I see the maintainers do not seem too active there, so maybe it's ok to leave this fork be.

@tgodzik tgodzik merged commit 057f7de into scalacenter:bloop-1.0.0 Nov 25, 2021
@tgodzik
Copy link

tgodzik commented Nov 25, 2021

For releasing I think it was done manually 🤔 I need to figure out who can be bothered to do it 😅

@alexarchambault alexarchambault deleted the custom-server-socket branch November 25, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants