nginx_upstream_module icon indicating copy to clipboard operation
nginx_upstream_module copied to clipboard

Add an option to pass a request to the next server on Lua error

Open toogle opened this issue 10 years ago • 4 comments

tnt_next_upstream option supports only few default strategies to pass a request to the next server. In some cases one may need to do it on Lua errors.

Possible solutions are:

  1. Return HTTP 500 on Lua errors and use default mask http_500.
  2. Add a special mask for this case (e.g. lua_error).

toogle avatar Jan 22 '16 08:01 toogle

Almost done but before push I wish to test this feature with balancer_by_lua - from ngx_lua.

Implementation details: -- nginx.conf { tnt_next_upstream tnt_error [masks..]; }

dedok avatar May 17 '16 20:05 dedok

@toogle Sytax/Option is ok for you. And also I'm interested, did you use balancer_by_lua?

dedok avatar May 17 '16 20:05 dedok

No, we didn't. Anyway, it would be great to have such functionality directly in upstream module instead of relying on ngx_lua.

toogle avatar May 18 '16 16:05 toogle

We also need box.error/error support in protocol, to correct balancing stream in upstream to avoid loss data by tarantool errors.

zloidemon avatar Oct 11 '17 08:10 zloidemon