You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=== TEST 30:log function location when failed torun a timer
1794
+
--- stream_config
1795
+
lua_max_running_timers 1;
1796
+
--- stream_server_config
1797
+
content_by_lua_block {
1798
+
local function g()
1799
+
ngx.sleep(0.01)
1800
+
end
1801
+
1802
+
local function f()
1803
+
ngx.sleep(0.01)
1804
+
end
1805
+
1806
+
local ok, err = ngx.timer.at(0, f)
1807
+
ifnotok then
1808
+
ngx.say("failed to create timer f: ", err)
1809
+
return
1810
+
end
1811
+
1812
+
local ok, err = ngx.timer.at(0, g)
1813
+
ifnotok then
1814
+
ngx.say("failed to create timer g: ", err)
1815
+
return
1816
+
end
1817
+
1818
+
ngx.say("ok")
1819
+
}
1820
+
--- stream_response
1821
+
ok
1822
+
--- wait:0.1
1823
+
--- error_log eval
1824
+
qr/\[alert\] .*? lua failed torun timer with function defined at =content_by_lua\(nginx.conf:\d+\):2: stream lua:1 lua_max_running_timers are not enough/
1825
+
--- no_error_log
1826
+
[emerg]
1827
+
[crit]
1828
+
[error]
1829
+
[warn]
1830
+
1831
+
1832
+
1833
+
=== TEST 31:log function location when failed torun a timer (anonymous function)
1834
+
--- stream_config
1835
+
lua_max_running_timers 1;
1836
+
--- stream_server_config
1837
+
content_by_lua_block {
1838
+
local function f()
1839
+
ngx.sleep(0.01)
1840
+
end
1841
+
1842
+
local ok, err = ngx.timer.at(0, f)
1843
+
ifnotok then
1844
+
ngx.say("failed to set timer f: ", err)
1845
+
return
1846
+
end
1847
+
1848
+
local ok, err = ngx.timer.at(0, function()
1849
+
ngx.sleep(0.01)
1850
+
end)
1851
+
1852
+
ifnotok then
1853
+
ngx.say("failed to set timer: ", err)
1854
+
return
1855
+
end
1856
+
1857
+
ngx.say("ok")
1858
+
}
1859
+
--- stream_response
1860
+
ok
1861
+
--- wait:0.1
1862
+
--- error_log eval
1863
+
qr/\[alert\] .*? lua failed torun timer with function defined at =content_by_lua\(nginx.conf:\d+\):12: stream lua:1 lua_max_running_timers are not enough/
1864
+
--- no_error_log
1865
+
[emerg]
1866
+
[crit]
1867
+
[error]
1868
+
[warn]
1869
+
1870
+
1871
+
1872
+
=== TEST 32:log function location when failed torun a timer (lua file)
0 commit comments