Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of _G is discouraged #127

Open
ktalebian opened this issue Jul 16, 2019 · 1 comment
Open

Use of _G is discouraged #127

ktalebian opened this issue Jul 16, 2019 · 1 comment

Comments

@ktalebian
Copy link

This library is using a global variable declaration, which is discouraged. I'm using the penlight library which uses this as a dependency, and this is polluting logs with

2019/07/16 13:36:26 [warn] 6089#19728145: *2 [lua] _G write guard:12: writing a global lua variable ('lfs') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables

More information can be found on openresty/lua-nginx-module#1558

@hishamhm
Copy link
Member

Yes, we are aware. But this is kept around for backwards compatibility. A gazillion scripts out there depend on lfs and assume that it sets the global so we can't remove it. When we release LuaFileSystem 2.0 (no ETA at this point), we will remove the global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants