Skip to content

lua: update deprecated lua_open to luaL_newstate#14297

Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
spacewander:luaL_newstate
Dec 8, 2020
Merged

lua: update deprecated lua_open to luaL_newstate#14297
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
spacewander:luaL_newstate

Conversation

@spacewander
Copy link
Contributor

@spacewander spacewander commented Dec 7, 2020

Commit Message: Use luaL_newstate instead of the deprecated lua_open
Additional Description:
lua_open is deprecated in Lua 5.1 and removed in the later version, though LuaJIT might keep the API unchanged.

Risk Level: Low. In LuaJIT, lua_open is just an alias of luaL_newstate.
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
Platform-Specific Features: N/A

Signed-off-by: spacewander spacewanderlzx@gmail.com

@repokitteh-read-only
Copy link

Hi @spacewander, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #14297 was opened by spacewander.

see: more, trace.

 lua_open is deprecated in Lua 5.1 and removed in the later version,
 though LuaJIT might keep the API unchanged.

 In LuaJIT, lua_open is just an alias of luaL_newstate.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Copy link
Member

@dio dio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A request for additional inline comment.

TEST_P(LuaIntegrationTest, RdsTestOfLuaPerRoute) {
// When the route configuration is updated dynamically via RDS and the configuration contains an
// inline Lua code, Envoy may call lua_open in multiple threads to create new lua_State objects.
// inline Lua code, Envoy may call luaL_newstate in multiple threads to create new lua_State objects.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. @spacewander could you add a link to luaL_newstate ref here? Thank you!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think you need to write it as:

`luaL_newstate`

instead of lua_newstate. to skip adding newstate to dictionary.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Copy link
Member

@dio dio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dio dio self-assigned this Dec 7, 2020
@mattklein123 mattklein123 merged commit fa80297 into envoyproxy:master Dec 8, 2020
mpuncel added a commit to mpuncel/envoy that referenced this pull request Dec 8, 2020
* master: (41 commits)
  event: Remove a source of non-determinism by always running deferred deletion before post callbacks (envoyproxy#14293)
  Fix TSAN bug in integration test (envoyproxy#14327)
  tracing: Add hostname to Zipkin config.  (envoyproxy#14186) (envoyproxy#14187)
  [conn_pool] fix use after free in H/1 connection pool (envoyproxy#14220)
  lua: update deprecated lua_open to luaL_newstate (envoyproxy#14297)
  extension: use bool_flag to control extension link (envoyproxy#14240)
  stats: Factor out creation of cluster-stats StatNames from creation of the stats, to save CPU during xDS updates (envoyproxy#14028)
  test: add scaled timer integration test (envoyproxy#14290)
  [Win32 Signals] Add term and ctrl-c signal handlers (envoyproxy#13954)
  config: v2 transport API fatal-by-default. (envoyproxy#14223)
  matcher: fix UB bug caused by dereferencing a bad optional (envoyproxy#14271)
  test: putting fake upstream config in a struct (envoyproxy#14266)
  wasm: use Bazel rules from Proxy-Wasm Rust SDK. (envoyproxy#14292)
  docs: fix typo (envoyproxy#14237)
  dependencies: allowlist CVE-2018-21270 to prevent false positives. (envoyproxy#14294)
  typo in redis doc (envoyproxy#14248)
  access_loggers: removed redundant dep (envoyproxy#14274)
  fix http2 flaky test (envoyproxy#14261)
  test: disable flaky xds_integration_test. (envoyproxy#14287)
  http: add functionality to configure kill header in KillRequest proto (envoyproxy#14288)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants