101 Commits

Author SHA1 Message Date
Darvame Hleran
df0c2ca1c8 lua_plugin: cache numbers set/update support 2015-09-29 13:26:48 +03:00
Hleran
da60423252 lua_plugin: cache_num, proper error type
- cache_num
and also swiched to wrong type for error status (tested with proper one, than ... "oh wait, we have empty 'i' variable!", later ... "oh sh size_t is uint!")
2015-09-29 00:31:24 +03:00
Hleran
5b9e2b5f39 lua_plugin: counting sid from 1
lua does not like count from 0
2015-09-23 17:07:04 +03:00
Hleran
8185b97030 lua_plugin: protected and unprotected __tostring
- protected and unprotected __tostring (protected outside, unprotected internal, avoid double pcall)
- also check userdata for metafields (non simple type)
- mywid and mysid are functions now
- minor api bump
2015-09-23 14:21:39 +03:00
Hleran
52ea02acad Fix 1039: lua_plugin queue segfault
lua stack iterator is not suitable for c arrays
2015-09-16 12:22:25 +03:00
Hleran
7e601d6d8d lua_plugin: cache_exists_multi, no false pls
return nil instead of false
2015-09-13 07:01:12 +03:00
Hleran
c2e83fe01d lua_plugin: last
fixes, fixes, removing unnecessary stuff
2015-09-13 06:24:26 +03:00
Hleran
637ead553a lua_plugin: mule: posible segfault, chunked_read
websocket_send __tostring metatable
2015-09-04 01:55:34 +03:00
Hleran
5ebc399cce lua_plugin: better mules 2015-09-03 00:45:51 +03:00
Hleran
f03f679a5c lua_plugin: mules, cache som fixes 2015-08-31 21:49:13 +03:00
Hleran
72ae69090a lua_plugin: cache_get, cache_get_tmulti
cache_get, cache_get_tmulti
returns key-value table
2015-08-30 02:01:59 +03:00
Hleran
1d595be2d9 lua_plugin: cleanup, more queues, more cache
and loop of nested tables inside headers
2015-08-27 23:15:29 +03:00
Hleran
a7181572e6 lua_plugin: queues, extend wsapi
dunno why so many additions and deletions
basic queues, remove cache_set_tables (cache_set will do it now)
extend wsapi with 4th argument without breaking it
2015-08-26 19:36:59 +03:00
Hleran
94ccb6b030 lua_plugin: mules
separate api, mules
2015-08-22 18:42:41 +03:00
Hleran
01d3133fce lua_plugin: remove atexit, fixes
don't spawn lua_states on workers, if nothing to run
cache multi_set,update,del also returns number of bad keys
remove atexit, does not work as expected
2015-08-21 18:29:04 +03:00
Hleran
377fc2d863 lua_plugin: metric, cache, fixes, cleanups 2015-08-21 01:25:12 +03:00
Hleran
8d2465db9b lua_plugin: lua_createtable, signals
using prehashed lua_createtable when we can instead of lua_newtable
plugin specific regsiter signal
add_file_monitor, add_timer, add_rb_timer, add_cron, alarm
2015-08-16 15:41:39 +03:00
Hleran
6921e8f820 lua_plugin: atexit, lazy signal routing
uwsgi_lua_atexit to commit garbage-collection metamethods
lazy signal routing: empty 'receiver' value on master table
2015-08-07 07:36:13 +03:00
Hleran
37971671cb lua_plugin: own signal ref table in each lua_State 2015-08-07 02:39:44 +03:00
Hleran
271c6aa13b lua_plugin: rpc via uwsgi.rpc_ref table 2015-08-06 19:40:52 +03:00
Hleran
c375920c63 lua_plugin: proper uwsgi.log
uwsgi.log like buildin print function
dummy response cfunction
2015-08-06 05:17:20 +03:00
Hleran
8e28051d2e lua_plugin: metatable.__tostring
also can yield and send metatable with __tostring attr;
some cleanups and optimizations;
2015-08-05 23:58:22 +03:00
Hleran
f3bc21cf2b lua_plugin: no switch in 1st yield; async_id_get()
If coroutine and async, do not switch until first yield of coroutine;
uwsgi.async_id_get() to get 'wsgi_req->async_id' in my app;
2015-07-31 01:03:40 +03:00
Hleran
a0dc7fdcf9 lua_plugin: wsapi func ref is constant, threading
correct multithreading support
2015-07-28 19:08:24 +03:00
Hleran
1e97a5e8d0 lua_plugin: malloc oversize 2015-07-28 13:04:11 +03:00
Hleran
4c152b237f lua_plugin: recheck async_status, clean threads
recheck async_status before pcall
keep our thread's stacks empty
2015-07-28 11:24:55 +03:00
Hleran
97304aded8 lua_plugin: better lazy check 2015-07-27 23:51:43 +03:00
Hleran
fc088d4071 lua_plugin: .post_fork to .init_apps and lazy-apps
yes,  lazy-apps and lazy works fine
2015-07-27 19:51:46 +03:00
Hleran
916924c255 lua_plugin: change default gc mode etc...
- lua gc default is now LUA_GCSTEP instead of LUA_GCCOLLECT, the default value of gc-freq 0 with full collection after each request is really overkill. LUA_GCSTEP with default gc-freq works better. But you can always change gc to full collect via 'lua-gc-full = 1' opt;

- if our coroutine yields unexpected nil while in async mode, we retry the coroutine's call again in order to detect dead coroutine without async switch

- and some cleanup
2015-07-27 13:56:29 +03:00
Hleran
cfaeb00a09 lua_plugin: .init_apps to .post_fork
trying to avoid seg_fault on very heavy load; (our workers now alloc memory for states and create it)
also our app can now work without wsapi app, it will just send 500 error code
2015-07-26 00:14:43 +03:00
Hleran
6b0a89a117 lua_plugin: lua_newthread instead of new_State
only ONE lua_State per 1 worker, and one lua thread per one worker's core.
so, 4 workers with 8000 async cores will not create 8000 lua_States, only 4, for each worker.
uwsgi table now also has lua_thread collection, and mywid variable.

Know bugs: too many simultaneously running cores (like async = 8000) without proper gc will cause segmentation fault (out of memory)
2015-07-22 21:28:25 +03:00
Hleran
59f6cd5453 lua_plugin: rpc uwsgi_malloc and missing free
I noticed that all cool kids are using uwsgi_malloc instead of malloc;
Also I noticed, that I forgot to free memory last time (while playing on high level languages)
2015-07-18 23:28:12 +03:00
Hleran
993fd384f1 some features
- rpc calls from my lua app ('local str = uwsgi.rpc(node, func_name, arg1, arg2, ...);')
- global "uwsgi.req_input_read" alias of local "env.input.read" function
- can yield numbers as well
- can return nil instead of header's table (same as {})
- can return nil or string (or number) instead of coroutine
2015-06-07 15:37:39 +03:00
Unbit
ed2ca5d333 request buffer_size is now 64bit (except for uwsgi protocol) 2014-09-21 08:26:20 +02:00
Mike Kaplinskiy
1a4f333912 Allow --async 1 (i.e. sync mode, but with a different loop engine) 2014-08-17 13:13:17 -04:00
Bruno Deferrari
ef12aaf13c Support for repeated headers in responses in the Lua plugin
This is needed for WSAPI conformance, and important for having
good support of Set-Cookie.
2014-04-24 17:30:09 -03:00
Unbit
1ba0935579 fixed lua prepare_headers 2013-12-28 18:39:30 +01:00
Riccardo Magliocchetti
473b4f1e57 plugins/lua: check return value of uwsgi_response_prepare_headers
Reported by Coverity as CID #1100802
2013-12-28 16:11:59 +01:00
Unbit
4e260fa8a1 fixed #476 and #477 2013-12-14 07:45:38 +01:00
Unbit
bb4be12fda implemented more async api in lua 2013-12-13 11:51:05 +01:00
Unbit
672fb0eaa6 added --lua-gc-freq 2013-12-13 09:07:44 +01:00
Unbit
6e2adf9cf3 added support for async api to lua 2013-12-12 13:42:12 +01:00
Unbit
7f004c5d6d removed async_force_again from lua 2013-12-12 13:34:25 +01:00
Unbit
13e7b53c54 async_force_again 2013-12-12 13:33:37 +01:00
Unbit
1c89522519 added websocket api to lua 2013-12-12 11:16:38 +01:00
Unbit
abed95362f another series of rpc 64bit fixes 2013-11-11 13:46:00 +01:00
Unbit
26386909de first attempt of moving rpc output from 16 to 64 bit 2013-11-11 13:00:20 +01:00
Natanael Copa
dad97bc104 add support for lua5.2
The default is still lua5.1 but 5.2 can be picked at compile time
but setting UWSGICONFIG_LUAPC=lua5.2
2013-06-24 14:35:31 +00:00
Unbit
575fc26bd7 try to support uclibc correctly 2013-06-24 16:01:43 +02:00
Unbit
375d6ee331 allows non-request plugin to register rpc functions 2013-04-21 09:43:45 +02:00