OpenResty Scalable Web Platform by Extending NGINX with Lua

ChangeLog 1.4.3

Yichun Zhang , 15 Dec 2013 (created 29 Oct 2013)

Mainline Version 1.4.3.9 - 14 December 2013

  • bugfix: the include path for LuaJIT C headers was still pointing to luajit-2.0, which should have been luajit-2.1 instead. thanks Tor Hveem for the report.

Mainline Version 1.4.3.7 - 14 December 2013

Stable Version 1.4.3.6 - 20 November 2013

Stable Version 1.4.3.4 - 12 November 2013

This release is essentially the same as the last mainline release, 1.4.3.3.

The following components are bundled in this release:

  • LuaJIT-2.0.2
  • array-var-nginx-module-0.03rc1
  • auth-request-nginx-module-0.2
  • drizzle-nginx-module-0.1.6
  • echo-nginx-module-0.49
  • encrypted-session-nginx-module-0.03
  • form-input-nginx-module-0.07
  • headers-more-nginx-module-0.23
  • iconv-nginx-module-0.10
  • lua-5.1.5
  • lua-cjson-1.0.3
  • lua-rds-parser-0.05
  • lua-redis-parser-0.10
  • lua-resty-dns-0.10
  • lua-resty-lock-0.01
  • lua-resty-memcached-0.12
  • lua-resty-mysql-0.14
  • lua-resty-redis-0.17
  • lua-resty-string-0.08
  • lua-resty-upload-0.09
  • lua-resty-websocket-0.02
  • memc-nginx-module-0.13
  • nginx-1.4.3
  • ngx_coolkit-0.2rc1
  • ngx_devel_kit-0.2.19
  • ngx_lua-0.9.2
  • ngx_postgres-1.0rc3
  • rds-csv-nginx-module-0.05
  • rds-json-nginx-module-0.12
  • redis-nginx-module-0.3.6
  • redis2-nginx-module-0.10
  • set-misc-nginx-module-0.22
  • srcache-nginx-module-0.24
  • xss-nginx-module-0.04

Mainline Version 1.4.3.3 - 6 November 2013

  • upgraded Lua Nginx Module to 0.9.2.
    • feature: added new API function ngx.re.find(), which is similar to ngx.re.match, but only returns the beginning index and end index (1-based) of the whole match, which is 30% ~ 40% faster than ngx.re.match for simplest regexes.
    • feature: added new API function ngx.config.prefix() to return the Nginx server "prefix" path.
    • bugfix: reading ngx.header.HEADER could result in Lua string storage corruptions. thanks Dane Knecht for the report.
    • bugfix: ngx.re.match: the "ctx" parameter table's "pos" field should start from 1 instead of 0.
    • bugfix: fixed compilation errors with Nginx older than 1.0.0.
    • bugfix: localizing the coroutine.* API functions in init_by_lua* for future use in contexts like content_by_lua* might hang the request. thanks James Hurst for the report.
  • upgraded Srcache Nginx Module to 0.24.
    • bugfix: fixed compilation errors with Nginx older than 0.9.2.
  • bugfix: applied the cache_manager_exit patch to the Nginx core to fix an issue when the cache manager process is shutting down.

Mainline Version 1.4.3.1 - 29 October 2013

  • upgraded the Nginx core to 1.4.3.
  • upgraded Lua Nginx Module to 0.9.1.
    • feature: added the new configuration directive lua_use_default_type for controlling whether to send out a default Content-Type response header (as defined by the default_type directive). default on. thanks aviramc for the patch.
    • feature: now the raw request cosocket returned by ngx.req.socket(true) no longer requires the request body to be read already, which means that one can use this cosocket to read the raw request body data as well. thanks aviramc for the original patch.
    • bugfix: when there were no existing Cache-Control response headers, ngx.header.cache_control = nil would (incorrectly) create a new Cache-Control header with an empty value. thanks jinglong for the patch.
    • bugfix: the original letter-case of the header name was lost when creating the Cache-Control response header via the ngx.header.HEADER API.
    • bugfix: ngx.req.set_header("Host", value) would overwrite the value of $host with bad values. thanks aviramc for the patch.
    • bugfix: use of ngx.exit() to abort pending subrequests in other "light threads" might lead to segfault or request hang when HTTP 1.0 full buffering is in effect.
    • bugfix: removing a request header might lead to memory corruptions. thanks Bjørnar Ness for the report.
    • bugfix: reading ngx.status might get different values than $status. thanks Kevin Burke for the report.
    • bugfix: downstream write events might interfere with upstream cosockets that are slow to write to. thanks Aviram Cohen for the report.
    • bugfix: the bookkeeping state for already-freed user threads might be incorrectly used by newly-created threads that were completely different, which could lead to bad results. thanks Sam Lawrence for the report.
    • bugfix: calling ngx.thread.wait() on a user thread object that is already waited (i.e., already dead) would hang forever. thanks Sam Lawrence for the report.
    • bugfix: the alert "zero size buf" could be logged when assigning an empty Lua string ("") to ngx.arg[1] in body_filter_by_lua*.
    • bugfix: subrequests initiated by ngx.location.capture* could trigger unnecessary response header sending actions in the subrequest because our capturing output header filter did not set r->header_sent.
    • bugfix: the Lua error message for the case that ngx.sleep() was used in log_by_lua* was not friendly. thanks Jiale Zhi for the report.
    • bugfix: now ngx.req.socket(true) returns proper error when there is some other "light thread" reading the request body.
    • bugfix: header_filter_by_lua, body_filter_by_lua, and ngx.location.capture* might not work properly with multiple "http {}" blocks in nginx.conf. thanks flygoast for the report.
    • optimize: made ngx.re.match and ngx.re.gmatch faster for LuaJIT 2.x when there is no submatch captures.
    • optimize: pre-allocate space for the Lua tables in various places.
    • doc: fixed the context for the lua_package_path and lua_package_cpath directives. thanks duhoobo for the report.
  • upgraded Headers More Nginx Module to 0.23.
    • bugfix: removing request headers via more_clear_input_headers might lead to memory corruptions.
    • bugfix: more_set_input_headers might overwrite the value of the $host variable with bad values.
    • bugfix: more_set_headers and more_clear_headers might not work when multiple "http {}" blocks were used in nginx.conf.
    • bugfix: eliminated use of C global variables during configuration phase because it might lead to issues when HUP reload failed.
  • upgraded Srcache Nginx Module to 0.23.
    • bugfix: this module might not work properly with multiple "http {}" blocks in nginx.conf.
    • bugfix: we might (incorrectly) return 500 in our output filters.
    • bugfix: we did not set r->header_sent when we want to discard the header in our header filter.
  • upgraded Rds Json Nginx Module to 0.12.
    • bugfix: in case of multiple "http {}" blocks in nginx.conf, our output filters might be disabled even when this module is configured properly.
    • bugix: we did not check the NULL pointer returned by an Nginx array element allocation.
  • upgraded Rds Csv Nginx Module to 0.05.
    • optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
  • upgraded Xss Nginx Module to 0.04.
    • optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
  • upgraded Echo Nginx Module to 0.49.
  • upgraded Lua Resty Redis Library to 0.17.
  • upgraded Lua Resty Upload Library to 0.09.
    • bugfix: removed use of the module() function to prevent bad side-effects.
    • optimize: Removed use of lua tables and table.concat() for simple one-line Lua string concatenations.
  • upgraded Lua Resty MySQL Library to 0.14.
    • bugfix: avoided using Lua 5.1's module() function for defining our Lua modules because it has bad side effects.
    • optimize: added an optional new argument "nrows" to the query() and read_result() methods, which can speed up things a bit.
    • optimize: use LuaJIT v2.1's new table.new() API to optimize Lua table allocations. when table.new is missing, just fall back to the good old "{}" constructor. this gives 12% overall speed-up for a typical result set with 500 rows when LuaJIT 2.1 is used.
    • optimize: eliminated use of table.insert() because it is slower than "tb[#tb + 1] = val".
    • optimize: switched over to the multi-argument form of string.char().
    • optimize: no longer use Lua tables and table.concat() to construct simple query strings.
  • upgraded Lua Resty Web Socket Library to 0.02.
    • optimize: use LuaJIT 2.1's table.new() to preallocate space for Lua tables, eliminating the overhead of Lua table rehash.
  • feature: applied the proxy_host_port_vars patch to the Nginx core to make $proxy_host and $proxy_port accessible for dynamic languages like Lua and Perl.
  • bugfix: applied the gzip_flush_bug patch to the Nginx core to fix request hang caused by the ngx_gzip and ngx_gunzip modules when using ngx.flush(true), for example. Thanks Maxim Dounin for the review.
  • bugfix: applied the cache_lock_hang_in_subreq patch to the Nginx core to fix the request hang when using proxy_cache_lock in subrequests and the cache lock timeout happens.
  • bugfix: backported Maxim Dounin's patch to fix an issue in the ngx_gzip module: it did not clear r->connection->buffered when the pending data was already flushed out. this could hang Lua Nginx Module's ngx.flush(true) call, for example. See ChangeLog 1.4.2 for change log for OpenResty 1.4.2.x.