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

Should print id of daemon that is processing the request #314

Closed
famod opened this issue Jan 8, 2021 · 8 comments
Closed

Should print id of daemon that is processing the request #314

famod opened this issue Jan 8, 2021 · 8 comments
Milestone

Comments

@famod
Copy link
Contributor

famod commented Jan 8, 2021

Yesterday, the daemon seemed stuck while builing Quarkus (it was actually downloading artifacts from a very slow source).
Another daemon was present so it was not immediately obvious which one was affected (e.g. for jstack or for stopping/killing).

I think it would come handy if the client would print the pid of the daemon that is processing the request.

PS: I could have probably pressed + to see what's going on but nevertheless I do think this would be helpful.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 8, 2021

+1 for myself. I'd also vote for using shorter daemon IDs. UUIDs are too long to display. E.g. a random Base64 string of length 6 would encode 6 * 6 = 36 bits, which would be more than enough for our use case. WDYT, @gnodet ?

@gnodet
Copy link
Contributor

gnodet commented Jan 8, 2021

+1 for myself. I'd also vote for using shorter daemon IDs. UUIDs are too long to display. E.g. a random Base64 string of length 6 would encode 6 * 6 = 36 bits, which would be more than enough for our use case. WDYT, @gnodet ?

Sounds good. Also, while at it, avoiding the use of SecureRandom would be nice, as it ties the client to all the security libs which it would be nice to get rid of in native mode. A crude version is available at https://github.com/fusesource/jansi/blob/master/src/main/java/org/fusesource/jansi/internal/JansiLoader.java#L223-L225

    private static String randomUUID() {
        return Long.toHexString(new Random().nextLong());
    }

@famod
Copy link
Contributor Author

famod commented Jan 8, 2021

UUIDs are too long to display

Yeah, that's one reason why the process id is better suited, IMHO. Another reason is that, even with a short daemon ID, you don't need to use --status to attach to the process or kill it forcefully.

@famod
Copy link
Contributor Author

famod commented Jan 8, 2021

@gnodet
Copy link
Contributor

gnodet commented Jan 8, 2021

+1 for myself. I'd also vote for using shorter daemon IDs. UUIDs are too long to display. E.g. a random Base64 string of length 6 would encode 6 * 6 = 36 bits, which would be more than enough for our use case. WDYT, @gnodet ?

But I'd rather avoid base64 and stick with hex. One of the reason is that it's used in the log file names and I'd rather avoid any possible problem with case sensitivity.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 8, 2021

OK, hex-encoded int would have 8 characters that sounds acceptable too. We'd have to abs() it so that it can't be negative.

gnodet added a commit to gnodet/mvnd that referenced this issue Jan 8, 2021
@gnodet
Copy link
Contributor

gnodet commented Jan 8, 2021

OK, hex-encoded int would have 8 characters that sounds acceptable too. We'd have to abs() it so that it can't be negative.

I've used the String.format("%08x") which does not add any - sign.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 8, 2021

OK, hex-encoded int would have 8 characters that sounds acceptable too. We'd have to abs() it so that it can't be negative.

I've used the String.format("%08x") which does not add any - sign.

+1, Math.abs() wouldn't work anyway

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

No branches or pull requests

3 participants