Hi again Willy,

On 18/10/2023 07:47, Willy Tarreau wrote:
[...]

     maybe we can have a 3rd value "auto" which would be the default
     and which would only log to stderr if there's no other logger ? I
     don't know if we have this info where it's used, though. Hmmm at
     first glance we seem to have it by testing if either px->loggers
     is non-empty or global.loggers is non-empty. Thus it could be the
     nicest approach, having "on" by default in 2.8 and older and "auto"
     on 2.9 maybe ?

I did go that route and thus split it into 2 patches (one for the flags + 'on' for that, and one that swaps from 'on' to 'auto').

Also from my reading of the config parser it seems to me like the global loggers are always appended to the proxy's loggers if 'log global' is used. So I opted to only check the proxy's loggers since I can see no situations where one has 1) some global loggers and 2) a proxy that expressly doesn't inherit log global and 3) nor any other proxy-specific logger target.

Anyway, that small question aside, I'm seeing some pretty strange discrepancy when compiling in different places.

ie in this snippet (hlua.c:1387):

static inline void hlua_sendlog(struct proxy *px, ...)
{
        ...
        if (... && (!LIST_ISEMPTY(&px->loggers)))
                return;

has the following results:
- locally from source => compiles happily
- locally from clone + patch => compile error
- in CI from clone + patch => compile error

When it fails, this is what I get back:

src/hlua.c:1417:86: error: ‘struct proxy’ has no member named ‘loggers’
1417 | if ((hlua_tune_flags & (HLUA_TUNE_LOG)) && (!LIST_ISEMPTY(&px->loggers))) | ^~
include/haproxy/list.h:102:28: note: in definition of macro ‘LIST_ISEMPTY’
  102 | #define LIST_ISEMPTY(lh) ((lh)->n == (lh))
      |                            ^~

Which would make sense if struct proxy had no such member, but it most certainly has one...

I must be missing something obvious, which hopefully someone can point out to me...

Regards,
Tristan

nb: don't want to waste your time by forcing to review the patches before I had a chance to properly test them, but if seeing them helps more than the error, they are here atm: https://github.com/mangadex-pub/haproxy/tree/93c92592bc693b53a27305152de80f544664f49d/haproxy/patches-dev

Reply via email to