pero on anything

MySQL Proxy Lua scripts cannot be written as a module?

Yesterday I went through hell while testing the MySQL Proxy partition Lua scripts I am working on in a high concurrency environment. I am sending multiple queries to the server and build up a combined result set in read_query_result – something like this. The proxy returned weird results complaining about multiple result sets being sent from time to time at totally different places even though I was sure that for each query only one result set has been sent. And some of the results were just wrong, a lot of our tests failed unexpectedly.

After long hours flicking almost every switch I simply removed the Lua module declaration from the main LUA script passed to the proxy via proxy-lua-script since it was the only thing left that changed. And then everything worked just fine!

I guess defining the proxy Lua script as a module messes up the scope of the script, but I haven’t researched that yet. So for now I just don’t declare the main proxy Lua script as a module and everything works fine.

One Response to “MySQL Proxy Lua scripts cannot be written as a module?”

  • Jan Kneschke says:

    You used:

    module(“pero”, package.seeall)

    ?

    Please see how the other modules and how load_multi.lua are handling it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">