Hi List, Thierry (LUA maintainer), Christopher (Multi-Threading),

When im making a tcp connection to a (mail) server from a lua task this error pops up randomly when using 'nbthread 4', the error luckily seems pretty self explanatory, but ill leave that to the threading and lua experts to come up with a fix ;) i think somehow the script or at least its socket commands must be forced to always be executed on the same thread? or perhaps there is another way..

Also i do wonder how far lua is safe to use at all in a multithreaded program. Or would that become impossible to keep safe.?. But thats a bit offtopic perhaps..

Line 240: recieve = mailer.receive(mailer, "*l")
[ALERT] 110/232212 (678) : Lua task: runtime error: /root/haproxytest/test.lua:240: connect: cannot use socket on other thread.

Line 266:  local mailer = core.tcp()
Line 267:    ret = mailer.connect(mailer, self.mailserver, self.mailserverport) [ALERT] 110/232321 (682) : Lua task: runtime error: /root/haproxytest/test.lua:267: connect: cannot use socket on other thread.

Let me know if there is a patch or something else i can test/check. Or should configure differently.?.
Thanks in advance.

Regards,

PiBa-NL (Pieter)

#### haproxy.conf & lua scripts####
Basically the serverhealth_smtpmail_haproxy.conf <https://github.com/PiBa-NL/MyPublicProjects/blob/master/haproxy/lua-scripts/serverhealth_smtpmail_haproxy.conf> and the files it links to are here:
https://github.com/PiBa-NL/MyPublicProjects/tree/master/haproxy/lua-scripts

p.s.
The 'mailer' code if anyone is interested that was used is written in some 'libraries' ive committed on github link, maybe they are of use to someone else as well :) comments and fixes are welcome ;).. They are 'first versions' but seem functional with limited testing sofar :).


Reply via email to