mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
As discussed in GH #2814, there is an ambiguity in hlua implementation that causes haproxy smp boolean type to be pushed as an integer on the Lua stack. On the other hand, when doing Lua to haproxy smp conversion, the boolean type is properly perserved. Of course this situation is not desirable and can lead to unexpected results. However we cannot simply fix the behavior because in Lua boolean and integer types are not are completely distinct types and cannot be used interchangeably. So in order to prevent breaking existing scripts logic, in this patch we add a dedicated lua tunable named "tune.lua.smp-preserve-bool" which can take the following values: - "on" : when converting haproxy smp to lua, boolean type is preserved - "off": when converting haproxy smp to lua, boolean is converted to integer (legacy behavior) For now, the tunable defaults to "off" to preserve historical behavior. However, when the option isn't set explicitly and lua is used, a warning will be emitted in order to raise user's awareness about this ambiguity. It is expected that the tunable could default to "on" in future versions, thus it is recommended to avoid setting it to "off" except when using existing Lua scripts that still rely on the old behavior regarding boolean smp to Lua conversion, and that they cannot be fixed easily. This should solve issue GH #2814. It may be relevant to backport this in haproxy 3.1. |
||
---|---|---|
.. | ||
design-thoughts | ||
internals | ||
lua-api | ||
51Degrees-device-detection.txt | ||
acl.fig | ||
coding-style.txt | ||
configuration.txt | ||
cookie-options.txt | ||
DeviceAtlas-device-detection.txt | ||
gpl.txt | ||
haproxy.1 | ||
HAProxyCommunityEdition_60px.png | ||
intro.txt | ||
lgpl.txt | ||
linux-syn-cookies.txt | ||
lua.txt | ||
management.txt | ||
netscaler-client-ip-insertion-protocol.txt | ||
network-namespaces.txt | ||
peers-v2.0.txt | ||
peers.txt | ||
proxy-protocol.txt | ||
queuing.fig | ||
regression-testing.txt | ||
seamless_reload.txt | ||
SOCKS4.protocol.txt | ||
SPOE.txt | ||
WURFL-device-detection.txt |