Re: [PATCH] CLEANUP: Use the ist() macro whenever possible

2021-03-04 Thread Willy Tarreau
Both cleanups applied, thank you Tim!
Willy



[PATCH] CLEANUP: Replace for loop with only a condition by while

2021-03-04 Thread Tim Duesterhus
Refactoring performed with the following Coccinelle patch:

@@
expression e;
statement S;
@@

- for (;e;)
+ while (e)
  S
---
 src/h2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/h2.c b/src/h2.c
index 84aa660b7..9ff3c938e 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -535,7 +535,7 @@ int h2_make_htx_request(struct http_hdr *list, struct htx 
*htx, unsigned int *ms
 * insert "; " before the new value.
 */
fs += tl; // first one is already counted
-   for (; (ck = list[ck].n.len) >= 0 ; ) {
+   while ((ck = list[ck].n.len) >= 0) {
vl = list[ck].v.len;
tl += vl + 2;
if (tl > fs)
-- 
2.30.1




Re: [2.2.9] 100% CPU usage

2021-03-04 Thread Christopher Faulet

Le 04/03/2021 à 14:01, Maciej Zdeb a écrit :

Hi,

Sometimes after HAProxy reload it starts to loop infinitely, for example 9 of 10 
threads using 100% CPU (gdb sessions attached). I've also dumped the core file 
from gdb.



Hi Maciej,

The 2.2.1O is out. But I'm afraid that a fix is missing. Could you test with the 
attached patch please ? On top of the 2.2.9 or 2.2.10, as you want.


Thanks,
--
Christopher Faulet
>From 6406528c25ec73ff0a47696ac2decde95867fdda Mon Sep 17 00:00:00 2001
From: Olivier Houchard 
Date: Thu, 18 Feb 2021 23:55:30 +0100
Subject: [PATCH] BUG/MEDIUM: lists: Avoid an infinite loop in
 MT_LIST_TRY_ADDQ().

In MT_LIST_TRY_ADDQ(), deal with the "prev" field of the element before the
"next". If the element is the first in the list, then its next will
already have been locked when we locked list->prev->next, so locking it
again will fail, and we'll start over and over.

This should be backported to 2.3.

(cherry picked from commit 5567f41d0ab61dd6843535edc8081407d599024d)
Signed-off-by: Christopher Faulet 
(cherry picked from commit 6f682bea6ab08830d17ef3e973be6cc4d2474e69)
Signed-off-by: Christopher Faulet 
---
 include/haproxy/list.h | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/haproxy/list.h b/include/haproxy/list.h
index 548c9b0f52..6233b2c79f 100644
--- a/include/haproxy/list.h
+++ b/include/haproxy/list.h
@@ -300,28 +300,28 @@
 			__ha_barrier_store();  \
 			continue;  \
 		}  \
-		n2 = _HA_ATOMIC_XCHG(>next, MT_LIST_BUSY); \
-		if (n2 != el) { /* element already linked */   \
-			if (n2 != MT_LIST_BUSY)\
-el->next = n2; \
+		p2 = _HA_ATOMIC_XCHG(>prev, MT_LIST_BUSY); \
+		if (p2 != el) {\
+			if (p2 != MT_LIST_BUSY)\
+el->prev = p2; \
 			p->next = n;   \
 			__ha_barrier_store();  \
 			lh->prev = p;  \
 			__ha_barrier_store();  \
-			if (n2 == MT_LIST_BUSY)\
+			if (p2 == MT_LIST_BUSY)\
 continue;  \
 			break; \
 		}  \
-		p2 = _HA_ATOMIC_XCHG(>prev, MT_LIST_BUSY); \
-		if (p2 != el) {\
-			if (p2 != MT_LIST_BUSY)\
-el->prev = p2; \
+		n2 = _HA_ATOMIC_XCHG(>next, MT_LIST_BUSY); \
+		if (n2 != el) { /* element already linked */   \
+			if (n2 != MT_LIST_BUSY)\
+el->next = n2; \
 			p->next = n;   \
-			el->next = el; \
+			el->prev = el; \
 			__ha_barrier_store();  \
 			lh->prev = p;  \
 			__ha_barrier_store();  \
-			if (p2 == MT_LIST_BUSY)\
+			if (n2 == MT_LIST_BUSY)\
 continue;  \
 			break; \
 		}  \
-- 
2.29.2



Re: Logging down output from the a Lua script

2021-03-04 Thread Mihaly Zachar
On Thu, 4 Mar 2021 at 13:49, Adis Nezirovic  wrote:

> On 3/4/21 1:39 PM, Mihaly Zachar wrote:
> > Dear Adis,
> >
> > Thank you very much for the prompt answer. It looks promising.
> > Yes, I do have the TXN object available.
> >
> > Currently I am checking the doc here:
> > http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#8.2.4
> > 
> >
> > How can I use the sent back variable I don't see that in the variable
> > table :(
> >
> > Thank
>
>
> You have a few examples in our blog post:
> https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/
>
> Basically, like using variables in HAProxy config, you need to set
> variable name using "scope.name" syntax, e.g. in the example scope is
> "req" (request), variable value is false.
>
> txn:set_var('req.blocked', false)
>
> Then, it should be able to log that variable by adding a block in
> log-format (no need to "capture" anything or similar):
>
> log-format "%{+Q}[var(txn.MyVar)]"
>
> A few blog posts about logging:
> https://www.haproxy.com/blog/introduction-to-haproxy-logging/
> https://www.haproxy.com/blog/haproxy-log-customization/
>
>
Hi Adis,

I was a bit too quick in the afternoon. I tried the thing from where I have
the TXN object available but it turned out that at that point I do not have
the result yet.
I also have a callback function registered with core.register_service(),
where I have the result I need to send back to the HAProxy layer.

It seems that this callback gets an AppletHTTP object. This object also has
a set_var() method.

If I do this:
applet:set_var('txn.myvar', 'myvar_value')

Then in the HAProxy layer I can reach the variable with %[var(txn.myvar)]
So it DOES work !
But Is this safe ? Did I do it well or I was just lucky ?

Thanks,
Misi


curious regarding SO_INCOMING_CPU

2021-03-04 Thread Илья Шипицин
Hello,

did anybody investigated benefits of SO_INCOMING_CPU ?
(just curious)

Ilya


[PATCH] fix some typo

2021-03-04 Thread Илья Шипицин
Hello,

another round of typo cleanup

Ilya
From a63c4b2373fd7fff2a02e57c79e2e2c85513ae00 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin 
Date: Thu, 4 Mar 2021 23:26:15 +0500
Subject: [PATCH] CLEANUP: assorted typo fixes in the code and comments

This is 19th iteration of typo fixes
---
 doc/internals/filters.txt | 10 +-
 doc/internals/htx-api.txt |  6 +++---
 src/flt_spoe.c|  2 +-
 src/server_state.c|  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/internals/filters.txt b/doc/internals/filters.txt
index 5c57107f1..da73acce5 100644
--- a/doc/internals/filters.txt
+++ b/doc/internals/filters.txt
@@ -296,7 +296,7 @@ instances attached to a stream :
 unsigned short flags;   /* STRM_FL_* */
 unsigned char  nb_req_data_filters; /* Number of data filters registered on the request channel */
 unsigned char  nb_rsp_data_filters; /* Number of data filters registered on the response channel */
-unsigned long long offset[2];   /* gloal offset of input data already filtered for a specific channle
+unsigned long long offset[2];   /* gloal offset of input data already filtered for a specific channel
  * 0: request channel, 1: response channel */
 };
 
@@ -628,7 +628,7 @@ For instance :
 /* ... */
 }
 
-Finally, it may be interesting to notifiy the filter when the stream is woken up
+Finally, it may be interesting to notify the filter when the stream is woken up
 because of an expired timer. This could let a chance to check some internal
 timeouts, if any. To do so the following callback must be used :
 
@@ -709,7 +709,7 @@ instance :
 'include/haproxy/channels-t.h'.
 
   * 'chn' is the channel on which the analyzing is done. It is possible to
-dertermine if it is the request or the response channel by testing if
+determine if it is the request or the response channel by testing if
 CF_ISRESP flag is set :
 
   │ ((chn->flags & CF_ISRESP) == CF_ISRESP)
@@ -986,7 +986,7 @@ available data (available from its point of view), blocking the data forwarding.
 Internally, filters own 2 offsets representing the number of bytes already
 analyzed in the available input data, one per channel. There is also an offset
 couple at the stream level, in the strm_flt object, representing the total
-number of bytes already forwarded. These offsets may be retrived and updated
+number of bytes already forwarded. These offsets may be retrieved and updated
 using following macros :
 
   * FLT_OFF(flt, chn)
@@ -1180,7 +1180,7 @@ update data itself, i.e. the buffer offsets, using following function :
 
   * 'flt_update_offsets()' : This function must be called when a filter alter
 incoming data. It updates offsets of the stream and of all filters
-preceeding the calling one. Do not call this function when a filter change
+preceding the calling one. Do not call this function when a filter change
 the size of incoming data leads to an undefined behavior.
 
 A good example of filter changing the data size is the HTTP compression filter.
diff --git a/doc/internals/htx-api.txt b/doc/internals/htx-api.txt
index c598c3864..516cd67a3 100644
--- a/doc/internals/htx-api.txt
+++ b/doc/internals/htx-api.txt
@@ -216,7 +216,7 @@ tunneled data. But tunneled data will never be mixed with message data to avoid
 ambiguities. Thus once the flag marking the end of the message is set, it is
 easy to know the message ends. The end is reached if the HTX message is empty or
 on the tail HTX block in the HTX message. Once all blocks of the HTX message are
-consumed, tunneled data, if any, may be transfered.
+consumed, tunneled data, if any, may be transferred.
 
 
 3.1. The start-line
@@ -519,8 +519,8 @@ block :
   pointing on the block payload is returned.
 
 - htx_is_unique_blk() may be used to know if a block is the only one
-  remaining inside an HTX message, excluding unsued blocks. This function is
-  pretty useful to determine the end of a HTX message, in conjonction with
+  remaining inside an HTX message, excluding unused blocks. This function is
+  pretty useful to determine the end of a HTX message, in conjunction with
   HTX_FL_EOM flag.
 
 4.7. Advanced functions
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 089f24860..fa81601c8 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -3102,7 +3102,7 @@ spoe_check(struct proxy *px, struct flt_conf *fconf)
 
 			if (!sink || sink->type != SINK_TYPE_BUFFER) {
 ha_alert("Proxy %s : log server used by SPOE agent '%s' declared"
-	 " at %s:%d uses unkown ring named '%s'.\n",
+	 " at %s:%d uses unknown ring named '%s'.\n",
 	 px->id, conf->agent->id, conf->agent->conf.file,
 	 conf->agent->conf.line, logsrv->ring_name);
 return 1;
diff --git a/src/server_state.c b/src/server_state.c
index a4df1fa7d..468cfd311 100644
--- a/src/server_state.c
+++ 

[PATCH] CLEANUP: Use the ist() macro whenever possible

2021-03-04 Thread Tim Duesterhus
Refactoring performed with the following Coccinelle patch:

@@
char *s;
@@

(
- ist2(s, strlen(s))
+ ist(s)
|
- ist2(strdup(s), strlen(s))
+ ist(strdup(s))
)

Note that this replacement is safe even in the strdup() case, because `ist()`
will not call `strlen()` on a `NULL` pointer. Instead is inserts a length of
`0`, effectively resulting in `IST_NULL`.
---
 src/check.c|  2 +-
 src/fcgi-app.c |  4 ++--
 src/http_ana.c |  2 +-
 src/listener.c |  2 +-
 src/mux_fcgi.c |  4 ++--
 src/mux_h1.c   |  2 +-
 src/server.c   |  2 +-
 src/stats.c|  2 +-
 src/tcpcheck.c | 28 ++--
 9 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/check.c b/src/check.c
index 0fab0d412..ba9c1f315 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1851,7 +1851,7 @@ static int srv_parse_check_proto(char **args, int 
*cur_arg,
memprintf(err, "'%s' : missing value", args[*cur_arg]);
goto error;
}
-   newsrv->check.mux_proto = get_mux_proto(ist2(args[*cur_arg + 1], 
strlen(args[*cur_arg + 1])));
+   newsrv->check.mux_proto = get_mux_proto(ist(args[*cur_arg + 1]));
if (!newsrv->check.mux_proto) {
memprintf(err, "'%s' :  unknown MUX protocol '%s'", 
args[*cur_arg], args[*cur_arg+1]);
goto error;
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index f4ce40c21..71f6dd48b 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -854,7 +854,7 @@ static int cfg_parse_fcgi_app(const char *file, int 
linenum, char **args, int kw
if (alertif_too_many_args_idx(0, 1, file, linenum, args, 
_code))
goto out;
istfree(>docroot);
-   curapp->docroot = ist2(strdup(args[1]), strlen(args[1]));
+   curapp->docroot = ist(strdup(args[1]));
if (!isttest(curapp->docroot)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, 
linenum);
err_code |= ERR_ALERT | ERR_ABORT;
@@ -887,7 +887,7 @@ static int cfg_parse_fcgi_app(const char *file, int 
linenum, char **args, int kw
if (alertif_too_many_args_idx(0, 1, file, linenum, args, 
_code))
goto out;
istfree(>index);
-   curapp->index = ist2(strdup(args[1]), strlen(args[1]));
+   curapp->index = ist(strdup(args[1]));
if (!isttest(curapp->index)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, 
linenum);
err_code |= ERR_ALERT | ERR_ABORT;
diff --git a/src/http_ana.c b/src/http_ana.c
index 5536c0402..c1245442f 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -2733,7 +2733,7 @@ int http_res_set_status(unsigned int status, struct ist 
reason, struct stream *s
/* Do we have a custom reason format string? */
if (!isttest(reason)) {
const char *str = http_get_reason(status);
-   reason = ist2(str, strlen(str));
+   reason = ist(str);
}
 
if (!http_replace_res_status(htx, ist2(trash.area, trash.data), reason))
diff --git a/src/listener.c b/src/listener.c
index 48ba8e0e4..400a7ebc2 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -1496,7 +1496,7 @@ static int bind_parse_proto(char **args, int cur_arg, 
struct proxy *px, struct b
return ERR_ALERT | ERR_FATAL;
}
 
-   proto = ist2(args[cur_arg + 1], strlen(args[cur_arg + 1]));
+   proto = ist(args[cur_arg + 1]);
conf->mux_proto = get_mux_proto(proto);
if (!conf->mux_proto) {
memprintf(err, "'%s' :  unknown MUX protocol '%s'", 
args[cur_arg], args[cur_arg+1]);
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 70b3d2272..fabc83e90 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -1269,7 +1269,7 @@ static int fcgi_set_default_param(struct fcgi_conn 
*fconn, struct fcgi_strm *fst
if (addr_to_str(cli_conn->dst, 
b_tail(params->p), b_room(params->p)) != -1)
ptr = b_tail(params->p);
if (ptr) {
-   params->srv_name = ist2(ptr, strlen(ptr));
+   params->srv_name = ist(ptr);
params->p->data += params->srv_name.len;
}
}
@@ -1281,7 +1281,7 @@ static int fcgi_set_default_param(struct fcgi_conn 
*fconn, struct fcgi_strm *fst
if (addr_to_str(cli_conn->src, b_tail(params->p), 
b_room(params->p)) != -1)
ptr = b_tail(params->p);
if (ptr) {
-   params->rem_addr = ist2(ptr, strlen(ptr));
+   params->rem_addr = ist(ptr);
params->p->data += params->rem_addr.len;
}
}
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 

[2.2.9] 100% CPU usage

2021-03-04 Thread Maciej Zdeb
Hi,

Sometimes after HAProxy reload it starts to loop infinitely, for example 9
of 10 threads using 100% CPU (gdb sessions attached). I've also dumped the
core file from gdb.

# haproxy -v
HA-Proxy version 2.2.9-a947cc2 2021/02/06 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2
2025.
Known bugs: http://www.haproxy.org/bugs/bugs-2.2.9.html
Running on: Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC
2019 x86_64

thread with high CPU is looping on:
809 if (HA_ATOMIC_CAS(_to_dump, , all_threads_mask))
(gdb)
811 ha_thread_relax();
(gdb)
809 if (HA_ATOMIC_CAS(_to_dump, , all_threads_mask))
(gdb)
811 ha_thread_relax();

it tried to panic but is failing (from bt full):
#0  0x7fa73309cf37 in sched_yield () at
../sysdeps/unix/syscall-template.S:78
No locals.
#1  0x559253cb7fce in ha_thread_relax () at include/haproxy/thread.h:233
No locals.
#2  ha_thread_dump_all_to_trash () at src/debug.c:811
old = 
#3  0x559253cb802f in ha_panic () at src/debug.c:268
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x7fa73309cf37 in sched_yield () at ../sysdeps/unix/syscall-template.S:78
78  ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt full
#0  0x7fa73309cf37 in sched_yield () at 
../sysdeps/unix/syscall-template.S:78
No locals.
#1  0x559253cb7fce in ha_thread_relax () at include/haproxy/thread.h:233
No locals.
#2  ha_thread_dump_all_to_trash () at src/debug.c:811
old = 
#3  0x559253cb802f in ha_panic () at src/debug.c:268
No locals.
#4  0x559253d23f08 in wdt_handler (sig=14, si=, 
arg=) at src/wdt.c:119
n = 
p = 
thr = 0
#5  
No locals.
#6  0x7fa73309cf37 in sched_yield () at 
../sysdeps/unix/syscall-template.S:78
No locals.
#7  0x559253cb9be5 in ha_thread_relax () at include/haproxy/thread.h:233
No locals.
#8  debug_handler (sig=, si=, arg=) at src/debug.c:859
sig = 
si = 
arg = 
#9  
No locals.
#10 0x559253bc642f in hlua_action (rule=0x5592596b5ba0, px=0x559259686260, 
sess=, s=0x55925b8f2fb0, flags=2) at src/hlua.c:6711
__pl_r = 4294967300
ret = 
arg = 
dir = 0
act_ret = 0
error = 
#11 0x559253c353c3 in http_req_get_intercept_rule 
(px=px@entry=0x559259686260, rules=rules@entry=0x5592596862b0, 
s=s@entry=0x55925b8f2fb0) at src/http_ana.c:2884
sess = 
txn = 0x55925b8f3790
rule = 0x5592596b5ba0
rule_ret = HTTP_RULE_RES_CONT
act_opts = 2
#12 0x559253c382f8 in http_process_req_common (s=s@entry=0x55925b8f2fb0, 
req=req@entry=0x55925b8f2fc0, an_bit=an_bit@entry=16, px=) at 
src/http_ana.c:501
sess = 
txn = 
msg = 
---Type  to continue, or q  to quit---
htx = 
rule = 
verdict = 
conn = 
#13 0x559253c48669 in process_stream (t=, 
context=0x55925b8f2fb0, state=) at src/stream.c:1781
max_loops = 
ana_list = 409648
ana_back = 409648
flags = 
srv = 
s = 0x55925b8f2fb0
sess = 
rqf_last = 
rpf_last = 2147483648
rq_prod_last = 
rq_cons_last = 0
rp_cons_last = 8
rp_prod_last = 0
req_ana_back = 
req = 0x55925b8f2fc0
res = 0x55925b8f3020
si_f = 0x55925b8f32e8
si_b = 0x55925b8f3340
rate = 
#14 0x559253d0a643 in run_tasks_from_lists 
(budgets=budgets@entry=0x7ffc669f811c) at src/task.c:483
process = 
tl_queues = 
t = 0x55925b8f34a0
budget_mask = 6 '\006'
done = 
queue = 
state = 
ctx = 
__ret = 
__n = 
__p = 
#15 0x559253d0b05d in process_runnable_tasks () at src/task.c:679
tt = 0x55925412f7c0 
lrq = 
grq = 
t = 
---Type  to continue, or q  to quit---
max = {0, 37, 25}
max_total = 
tmp_list = 
queue = 3
max_processed = 
#16 0x559253cc1df7 in run_poll_loop () at src/haproxy.c:2939
next = 
wake = 
#17 0x559253cc21a9 in run_thread_poll_loop (data=) at 
src/haproxy.c:3104
ptaf = 
ptif = 
ptdf = 
ptff = 
init_left = 0
init_mutex = pthread_mutex_t = {Type = Normal, Status = Not acquired, 
Robust = No, Shared = No, Protocol = None}
init_cond = pthread_cond_t = {Threads known to still execute a wait 
function = 0, Clock ID = CLOCK_REALTIME, Shared = No}
#18 0x559253b95840 in main (argc=, argv=0x7ffc669f8658) at 
src/haproxy.c:3803
blocked_sig = {__val = {1844674406710583, 18446744073709551615 
}}
old_sig = {__val = {0, 13925524187434950144, 0, 140722030216352, 8, 32, 
12884901897, 7, 48, 94086972698648, 80, 18446744073709409504, 0, 206158430211, 
0, 0}}
i = 
err = 
retry = 
limit = 

Re: Logging down output from the a Lua script

2021-03-04 Thread Mihaly Zachar
On Thu, 4 Mar 2021 at 13:49, Adis Nezirovic  wrote:

> On 3/4/21 1:39 PM, Mihaly Zachar wrote:
> > Dear Adis,
> >
> > Thank you very much for the prompt answer. It looks promising.
> > Yes, I do have the TXN object available.
> >
> > Currently I am checking the doc here:
> > http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#8.2.4
> > 
> >
> > How can I use the sent back variable I don't see that in the variable
> > table :(
> >
> > Thank
>
>
> You have a few examples in our blog post:
> https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/
>
> Basically, like using variables in HAProxy config, you need to set
> variable name using "scope.name" syntax, e.g. in the example scope is
> "req" (request), variable value is false.
>
> txn:set_var('req.blocked', false)
>
> Then, it should be able to log that variable by adding a block in
> log-format (no need to "capture" anything or similar):
>
> log-format "%{+Q}[var(txn.MyVar)]"
>
> A few blog posts about logging:
> https://www.haproxy.com/blog/introduction-to-haproxy-logging/
> https://www.haproxy.com/blog/haproxy-log-customization/



Dear Adis,

Sorry, my previous email was sent to you rather than to the list.
Thank you very much, this is what I did look for !

Great stuff, happy days.

Thanks,
Misi


Re: Logging down output from the a Lua script

2021-03-04 Thread Adis Nezirovic

On 3/4/21 12:22 PM, Mihaly Zachar wrote:

Sorry, the above might be misunderstood.

I would like to log from the frontend, because some timer values are 
available only there.
So I know that I can send log from the Lua script using core.log() but I 
need to have the information in the frontend.
If you use Lua for action or service (i.e. you have txn object readily 
available in the script), you can use txn:set_var(name, value) to 
communicate stuff back to regular HAProxy layer, and then log the value 
of the variable with rest of the stuff.


Best regards,
--
Adis Nezirovic
Software Engineer
HAProxy Technologies - Powering your uptime!
375 Totten Pond Road, Suite 302 | Waltham, MA 02451, US
+1 (844) 222-4340 | https://www.haproxy.com



Re: Logging down output from the a Lua script

2021-03-04 Thread Mihaly Zachar
On Thu, 4 Mar 2021 at 12:14, Mihaly Zachar  wrote:

> Hi All,
>
> I wrote a small HTTP redirect server using HAProxy and Lua.
> My question is thet is it possible to log down a value coming from the Lua
> script somehow ?
>
> I am wondering if maybe we can use the "capture" method or something
> similar.
>
> I have not found anything in the docs unfortunately, but I am still hoping
> that I missed a possibility.
>
> Thanks in advance.
>
> Regards,
> Misi
>


Sorry, the above might be misunderstood.

I would like to log from the frontend, because some timer values are
available only there.
So I know that I can send log from the Lua script using core.log() but I
need to have the information in the frontend.

 Thanks,
Misi


Logging down output from the a Lua script

2021-03-04 Thread Mihaly Zachar
Hi All,

I wrote a small HTTP redirect server using HAProxy and Lua.
My question is thet is it possible to log down a value coming from the Lua
script somehow ?

I am wondering if maybe we can use the "capture" method or something
similar.

I have not found anything in the docs unfortunately, but I am still hoping
that I missed a possibility.

Thanks in advance.

Regards,
Misi