stream-lua-nginx-module icon indicating copy to clipboard operation
stream-lua-nginx-module copied to clipboard

Add shdict set_when, safe_set_when, and store_when

Open hnakamur opened this issue 6 years ago • 3 comments

This pull request adds set_when and safe_set_when methods to ngx.shared.DICT. It also adds ngx_stream_lua_ffi_shdict_store_when which is used in Add shdict set_when and safe_set_when by hnakamur · Pull Request #268 · openresty/lua-resty-core.

I hereby granted the copyright of the changes in this pull request to the authors of this lua-resty-core project.

hnakamur avatar Aug 07 '19 15:08 hnakamur

Test with the following pull request fails at https://travis-ci.org/hnakamur/stream-lua-nginx-module/builds/569568232

  • https://github.com/openresty/lua-nginx-module/pull/1574
  • https://github.com/openresty/lua-resty-core/pull/268

https://travis-ci.org/hnakamur/stream-lua-nginx-module/jobs/569568238

#   Failed test 'TEST 5: lua_load_resty_core 'on' in stream block and 'off' in http block - response_body - response is expected (repeated req 0, req 0)
# @@ -1,2 +1,2 @@
#  resty.core loaded in stream: true
# -resty.core loaded in http: false
# +resty.core loaded in http: true
# '
#   at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1589.

Tests fails since resty.core is not loaded in http, but I don't know the reason yet. Could you give some advice to investigate? Thanks!

hnakamur avatar Aug 08 '19 22:08 hnakamur

Ah I see.

nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16)

So resty.core is always loaded, then existing tests in stream-lua-nginx-module should be updated.

hnakamur avatar Aug 11 '19 05:08 hnakamur

Test passes at https://travis-ci.org/hnakamur/stream-lua-nginx-module/builds/570491636 with t/161-load-resty-core.t deleted.

hnakamur avatar Aug 11 '19 14:08 hnakamur