Repository navigation
Add proc-title-template option. - #8397
Conversation
Make it possible to customize the process title, i.e. include custom strings, immutable configuration like port/tls-port/unix socket name, etc.
|
@redis/core-team please approve |
madolson
left a comment
There was a problem hiding this comment.
Just a nitpick, I think the API is good.
|
Also, do we still need this separate flag? #3623 We could have an empty string indicate to not use a custom title. |
|
In theory someone may actually use an empty string. The one problem I see is that resetting it to "" at runtime will need to fetch the initial value from somewhere (it's not the exact same as "don't mess with the proc-title" ) |
|
Part of the reason I mention it is just that the current PR will reject setting the template to an empty string. (Or a string composed of all spaces for that matter). |
|
I prefer to have an explicit configuration, even if we currently reject an empty title string and could use it as a hint. |
oranagra
left a comment
There was a problem hiding this comment.
sorry for speaking late, but the verify function is needed for the config file parsing.
without it, the string will be loaded as is, and the validity will only be checked later when applying it (which may have some implications, one of them is not seeing the line number of the config line in the error message)
This reverts commit ee6d723.
|
sorry for pushing early and not stopping to think before doing that :) |
|
I was expecting we would call exit(1) when that fails in server.c, which is what we typically do anyways. If there is something wrong with our TLS config for example, we exit(1) when trying to start everything, not validate it ahead of time. Having double validation is hard to follow, but I guess throwing a concrete "this config is wrong" is also nice. |
|
other than printing the config and line number.. The timing if that exit and print can make some difference. |
| initServer(); | ||
| if (background || server.pidfile) createPidFile(); | ||
| redisSetProcTitle(argv[0]); | ||
| redisSetProcTitle(NULL); |
There was a problem hiding this comment.
Can we assert here then, and not silently ignore the error code?
|
Ok, if we want the error there (Not sure if TLS has the same problem, not sure where we daemonize), it'd be nice to clear up the expectations around the functions. I just don't like the extra "this should never happen, but if it does" we're just going to write a log. |
|
I actually think it makes sense to consider two steps here:
That may not apply to some trivial configs, but in other cases it's inevitable. |
# Conflicts: # redis.conf # src/server.c # src/server.h
Make it possible to customize the process title, i.e. include custom strings, immutable configuration like port, tls-port, unix socket name, etc.
Make it possible to customize the process title, i.e. include custom
strings, immutable configuration like port/tls-port/unix socket name,
etc.
The default template format is backwards compatible, with the exception
of Redis instances that have only Unix domain sockets (no port/tls-port)
which will now report their listening socket.
Fixes #694, #2081