doujiang24 / lua-resty-kafka

Lua kafka client driver for the Openresty based on the cosocket API
BSD 3-Clause "New" or "Revised" License
804 stars 275 forks source link

ERROR: malformed number #10

Closed kevinma2010 closed 9 years ago

kevinma2010 commented 9 years ago
2015/08/14 15:03:34 [error] 17858#0: *122 failed to run log_by_lua*: error loading module 'resty.kafka.response' from file '/usr/local/sh
1306     /usr/local/share/lua/5.1/resty/kafka/response.lua:76: malformed number near '4294967296LL'
1307 stack traceback:
1308     [C]: ?
1309     [C]: in function 'require'
1310     /usr/local/share/lua/5.1/resty/kafka/producer.lua:4: in main chunk
1311     [C]: in function 'require'
1312     /etc/nginx/lua/log/log_into_kafka.lua:1: in function </etc/nginx/lua/log/log_into_kafka.lua:1> while logging request, client: 14.153.
1313 2015/08/14 15:03:35 [error] 17858#0: *122 failed to run log_by_lua*: /etc/nginx/lua/log/log_into_kafka.lua:1: loop or previous error load
1314 stack traceback:
1315     [C]: in function 'require'
doujiang24 commented 9 years ago

hi, seems you are not using LuaJIT, LL means long int in LuaJIT, and doesn't work in Lua.

I'll add a notice in the readme, thanks

kevinma2010 commented 9 years ago

but i'm not using LuaJIT

2015-08-14 15:25 GMT+08:00 doujiang notifications@github.com:

hi, seems you are not using LuaJIT, LL means long int in LuaJIT, and doesn't work in Lua.

I'll add a notice in the readme, thanks

— Reply to this email directly or view it on GitHub https://github.com/doujiang24/lua-resty-kafka/issues/10#issuecomment-131003964 .

doujiang24 commented 9 years ago

because Lua number only have 52 bit accuracy. http://lua-users.org/wiki/FloatingPoint

kevinma2010 commented 9 years ago

i am very strange, because it is ok when i use LuaJit..

2015-08-14 15:47 GMT+08:00 doujiang notifications@github.com:

because Lua number only have 52 bit accuracy. http://lua-users.org/wiki/FloatingPoint

— Reply to this email directly or view it on GitHub https://github.com/doujiang24/lua-resty-kafka/issues/10#issuecomment-131009067 .

doujiang24 commented 9 years ago

@lenbo-ma yes, you can consider LuaJIT is an another language, it's not all the same compared to Lua.