isage / lua-resty-moongoo

MongoDB library for OpenResty
Do What The F*ck You Want To Public License
118 stars 33 forks source link

No LUA 5.1 support? #1

Closed CriztianiX closed 7 years ago

CriztianiX commented 7 years ago

Hey, check this out!

Using luajit, this works

[mundodescuento@localhost ~]$ luajit counting.lua
1000

But using lua 5.1 with:

luabitop
   1.0.2-3 (installed) - /usr/lib/luarocks/rocks
luacrypto
   0.3.2-2 (installed) - /usr/lib/luarocks/rocks
luasocket
   3.0rc1-2 (installed) - /usr/lib/luarocks/rocks

I get

[mundodescuento@localhost ~]$ lua counting.lua
lua: /usr/share/lua/5.1/resty/moongoo/connection.lua:61: closed
stack traceback:
        [C]: in function 'assert'
        /usr/share/lua/5.1/resty/moongoo/connection.lua:61: in function </usr/share/lua/5.1/resty/moongoo/connection.lua:60>
        (tail call): ?
        /usr/share/lua/5.1/resty/moongoo/database.lua:42: in function '_cmd'
        /usr/share/lua/5.1/resty/moongoo.lua:68: in function 'connect'
        /usr/share/lua/5.1/resty/moongoo/database.lua:22: in function 'cmd'
        /usr/share/lua/5.1/resty/moongoo/cursor.lua:202: in function 'count'
        counting.lua:13: in main chunk
        [C]: ?
isage commented 7 years ago

I'm actually testing this with lua 5.1 Works for me with luabitlib 5.3.0-1, luacrypto-0.3.2-1 and luasocket 3.0rc1-3

Can you try with bitlib instead of bitop?

CriztianiX commented 7 years ago

This one http://luaforge.net/projects/bitlib/ ?

isage commented 7 years ago

yep

On Dec 29, 2016 5:02 PM, "Cristian Haunsen" notifications@github.com wrote:

This one http://luaforge.net/projects/bitlib/ ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/isage/lua-resty-moongoo/issues/1#issuecomment-269634101, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQtITjsS-HsF7M_JZOxU09igMYLDNz-ks5rM72GgaJpZM4LXkde .

CriztianiX commented 7 years ago

I cannot test! I 've some dependencies using bitOp, so, i cannot remove it

Anyway the page says the following

bitlib is a tiny library for bitwise operations. It is now deprecated in favour of bitop: http://bitop.luajit.org/

isage commented 7 years ago

well, yep. they should be compatible. sorry, i can take a look at it only after holidays. meanwhile, is there something standing out in mongodb logs?

On Dec 29, 2016 5:11 PM, "Cristian Haunsen" notifications@github.com wrote:

I cannot test! I 've some dependencies using bitOp, so, i cannot remove it

Anyway the page says the following

bitlib is a tiny library for bitwise operations. It is now deprecated in favour of bitop: http://bitop.luajit.org/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/isage/lua-resty-moongoo/issues/1#issuecomment-269635179, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQtIeeIiV2YA1Q0rQN2wLBGkg2k--GZks5rM7-IgaJpZM4LXkde .

CriztianiX commented 7 years ago

Wow... in mongodb logs i get:

2016-12-28T22:53:50.437+0000 [conn118] AssertionException handling request, closing client connection: 17132 SSL handshake received but server is started without SSL support

isage commented 7 years ago

This shouldn't be related, as moongoo doesn't have support for ssl yet. But, it seems like mongodb throws this error in completely unrelated cases. What version of mongodb are you using?

CriztianiX commented 7 years ago

I'm using mongodb-2.6.12-3.el7.x86_64 CentOS Linux release 7.2.1511 (Core)

CriztianiX commented 7 years ago

The same error running on Ubuntu 16.04 mongodb-server 1:2.6.10-0ubuntu1

isage commented 7 years ago

Okay, that's a bug in lua-cbson Should be fixed with https://github.com/isage/lua-cbson/commit/de748dab19e5e56aa3faf7c214c70a96d2b62ea5

CriztianiX commented 7 years ago

Good notice!! Works like a Charm!