Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-5816

Suppress "_G write guard" warn messages to be output on APIcast startup

    XMLWordPrintable

Details

    • No

    Description

      Apicast logs these warn messages on startup. They are harmless but noisy, several customers have noticed them and are had asked.
      According to this OpenResty issue, it won't be logged when the global variables are changed to local variables, or add rawset(_G, '<variable>', false) before including the variable.
      So please suppress the messages.

      2020/08/01 00:00:00 [warn] 15#15: *2 [lua] _G write guard:12: __newindex(): writing a global Lua variable ('sanitize_replace') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
      stack traceback:
              /usr/local/share/lua/5.1/liquid.lua:132: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/cli/template.lua:13: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/cli/command/start.lua:17: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/cli.lua:18: in function 'load_commands'
              /opt/app-root/src/src/apicast/cli.lua:23: in main chunk
              [C]: in function 'require'
              /tmp/xxxxxxxx:60: in function 'file_gen'
              init_worker_by_lua:49: in function <init_worker_by_lua:47>
              [C]: in function 'xpcall'
              init_worker_by_lua:56: in function <init_worker_by_lua:54>, context: ngx.timer
      
      2020/08/01 00:00:00 [warn] 15#15: *2 [lua] _G write guard:12: writing a global Lua variable ('yaml') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
      stack traceback:
              [C]: at 0x7fafc162f140
              [C]: in function 'require'
              /usr/local/share/lua/5.1/lyaml/init.lua:34: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/resty/yaml.lua:6: in main chunk
              [C]: in function 'require'
              ...p-root/src/src/apicast/configuration_loader/data_url.lua:9: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/configuration_loader.lua:5: in main chunk
              [C]: in function 'root_require'
              ...
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/cli/command/start.lua:18: in main chunk
              [C]: in function 'require'
              /opt/app-root/src/src/apicast/cli.lua:18: in function 'load_commands'
              /opt/app-root/src/src/apicast/cli.lua:23: in main chunk
              [C]: in function 'require'
              /tmp/xxxxxxxx:60: in function 'file_gen'
              init_worker_by_lua:49: in function <init_worker_by_lua:47>
              [C]: in function 'xpcall'
              init_worker_by_lua:56: in function <init_worker_by_lua:54>, context: ngx.timer
      
      2020/08/01 00:00:00 [warn] 15#15: *2 [lua] _G write guard:12: __newindex(): writing a global Lua variable ('result') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
      stack traceback:
              /usr/local/share/lua/5.1/liquid.lua:134: in function 'sanitize_replace'
              /usr/local/share/lua/5.1/liquid.lua:2998: in function </usr/local/share/lua/5.1/liquid.lua:2996>
              [C]: in function 'pcall'
              /usr/local/share/lua/5.1/liquid.lua:2423: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2042: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2018: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2501: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2018: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2018: in function 'interpret'
              /usr/local/share/lua/5.1/liquid.lua:2453: in function 'visit'
              ...
              /usr/local/share/lua/5.1/liquid.lua:2018: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2269: in function 'visit'
              /usr/local/share/lua/5.1/liquid.lua:2018: in function 'render'
              /opt/app-root/src/src/apicast/cli/command/start.lua:57: in function 'nginx_config'
              /opt/app-root/src/src/apicast/cli/command/start.lua:171: in function 'start'
              /opt/app-root/src/src/apicast/cli.lua:50: in function </opt/app-root/src/src/apicast/cli.lua:30>
              /tmp/xxxxxxxx:60: in function 'file_gen'
              init_worker_by_lua:49: in function <init_worker_by_lua:47>
              [C]: in function 'xpcall'
              init_worker_by_lua:56: in function <init_worker_by_lua:54>, context: ngx.timer
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-tkonishi Takayuki Konishi
              Eloy Coto Eloy Coto
              David Rajnoha David Rajnoha
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: