Open jesperpedersen opened 2 weeks ago
With regard to the conf reload
, I found that here https://github.com/agroal/pgagroal/blob/master/src/main.c#L2586 there is an explicit exit(0)
(and similarly exit(1)
on the error path), that is also not consistent with the function defintion that is supposed to return a bool
.
@jesperpedersen PTAL commit ea07bd4 that implements conf get
to see if I get it right.
Please note that there is some sort of user after free bug somewhere, but I've not digged it a lot. It could be that destroying the JSON object after writing the response suffice. Take a look at the following two executions: the first is ok, the secondis in error but reports the same configuration value for the requested key.
% pgagroal-cli conf get log_level
Header:
ClientVersion: 2.0.0
Command: 2
Compression: none
Encryption: none
Output: text
Timestamp: 20241113123146
Outcome:
Status: true
Time: 00:00:00
Request:
ConfigurationKey: log_level
Response:
ServerVersion: 2.0.0
log_level: debug
% pgagroal-cli conf get log_
Header:
ClientVersion: 2.0.0
Command: 2
Compression: none
Encryption: none
Output: text
Timestamp: 20241113123152
Outcome:
Error: 1
Status: false
Request:
ConfigurationKey: log_
Response:
ServerVersion: 2.0.0
log_: debug
@fluca1978 All the CONF_XYZ
work will be ported from https://github.com/pgmoneta/pgmoneta/pull/409 once done.
@fluca1978 All the
CONF_XYZ
work will be ported from pgmoneta/pgmoneta#409 once done.
Ok, so this is a "phantom" issue. Hope at least my initial work can be useful.
Yeah, so it doesn't fly out of my head and we have a feature regression
Testing head f34e4f93d8e0e93ccf2f403ed486eb088fb8cd79:
and most notably:
and for the last command
conf reload
thepgagroal
logs show: