Greetings!
I’m developing a SPOA. The place I stuck is a setting var via an ACK message.
In the haproxy log always the same message repeated twice:
SPOE: [request_cacher] <EVENT:on-frontend-http-request> sid=0 st=1 0/6/-1/-1/11 0/1 0/0 1/1
Judging on st=1 there is some IO error.
In lua func I’m trying to get var this way:
core.Info("Headers :" .. txn:get_var("sess.request_cacher.hdrs"))
And got a haproxy log message: Lua function 'pre_node_rp_route': [state-id 0] runtime error: /etc/haproxy/lua/register.lua:2: attempt to concatenate a nil value from /etc/haproxy/lua/register.lua:2: in function line 1.
Hello interaction works well. As well as the NOTIFY frame decoding.
Below is hexed ACK example without length prefix (contains a set var action with a byte array content):
67000000010201010301046864727309f0030d782d7465726d696e616c2d69640a313233343536373839300d617574686f72697a6174696f6e164261736963206447567a644445366447567a6444453d0c636f6e74656e742d74797065106170706c69636174696f6e2f6a736f6e0a757365722d6167656e7415506f73746d616e52756e74696d652f372e32392e3006616363657074032a2f2a0d63616368652d636f6e74726f6c086e6f2d63616368650d706f73746d616e2d746f6b656e2438353236396461342d326338392d346335632d393434352d37386266376362356430623204686f73741031302e32302e302e34393a31303038300f6163636570742d656e636f64696e6711677a69702c206465666c6174652c2062720e636f6e74656e742d6c656e67746804313337330000
Haproxy version - 2.4
haproxy configuration:
[haproxy.cfg]
…
frontend a_cluster
bind *:10080
filter spoe engine request-cache config /etc/haproxy/request-cache.conf
http-request wait-for-body time 1s at-least 10k
http-request lua.pre_node_rp_route rp_cluster_nodes
…
backend agent
mode tcp
balance roundrobin
timeout connect 5s # greater than hello timeout
timeout server 3m # greater than idle timeout
option spop-check
server iye 10.10.0.10:9000 check
[request-cache.conf]
[request-cache]
spoe-agent request_cacher
option force-set-var
option var-prefix request_cacher
messages http-request-payload
timeout hello 2s
timeout idle 2m
timeout processing 10ms
use-backend agent
log global
spoe-message http-request-payload
args hdrs=req.hdrs_bin body=req.body
event on-frontend-http-request
Could anyone tell me what am I doing wrong ?
Thanks in advance for your answers.