Hello!
On Tue, Jul 23, 2013 at 12:01 AM, jijilu wrote:
>
> After turn lua_code_cache on,
>
> local xml = require("LuaXml");
> local uri = "";
> local res = ngx.location.capture(uri);
> if res.status == 200 then
> local pr_xml = xml.eval(prdata);
> local xscene = pr_xml:find("DomesticFlightRoute");
> local rcs = tonumber(xscene[1][1]);
>
> rcs will be nil when system load in case of high concurrent rate.
>
By looking at the source code of LuaXML 1.7.4 (as seen here:
http://viremo.eludi.net/LuaXML/#download ), one obvious mistake in the
xml.eval function's implementation (i.e., the Xml_eval C function) is
use of lua_getglobal to access the "xml" global variable. Descent Lua
modules should never assume that such a global variable exists (nor
polluting the global environment for any reasons). You should ask the
author of LuaXML to fix this issue on his side or you can look for a
better Lua library that can do XML.
BTW, please join the mailing list before posting. Otherwise, your
posts always require manual moderation.
Best regards,
-agentzh