-
Notifications
You must be signed in to change notification settings - Fork 51
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
avoid self.targets
is nil.
#44
Conversation
@juzipeek I'm not sure this fix is correct. That table (which you are initializing) is already initialized here: lua-resty-healthcheck/lib/resty/healthcheck.lua Line 1410 in aab3701
If it is not initialized, then it failed to acquire the lock, with should result in this code: lua-resty-healthcheck/lib/resty/healthcheck.lua Lines 1427 to 1431 in aab3701
So effectively the call to lua-resty-healthcheck/lib/resty/healthcheck.lua Line 1440 in aab3701
So what was the initial error you got? Or can you provide a testcase demonstrating the issue? |
looks same as #42 |
when two worker create `checker`, `worker-0` first created and add target success, then `worker-1` creating, when `worker-1` call `worker_events:poll()` in line 1408, raise crash. `self.targets` init with empty table avoid this.
reconsidering this, since it is async, it might not be initialized, so this is a proper fix |
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
### Summary * BREAKING: fallback for deprecated top-level field `type` is now removed (deprecated since `0.5.0`) [#56](Kong/lua-resty-healthcheck#56) * BREAKING: Bump `lua-resty-worker-events` dependency to `2.0.0`. This makes a lot of the APIs in this library asynchronous as the worker events `post` and `post_local` won't anymore call `poll` on a running worker automatically, for more information, see: https://github.com/Kong/lua-resty-worker-events#200-16-september-2020 * BREAKING: tcp_failures can no longer be 0 on http(s) checks (unless http(s)_failures are also set to 0) [#55](Kong/lua-resty-healthcheck#55) * feature: Added support for https_sni [#49](Kong/lua-resty-healthcheck#49) * fix: properly log line numbers by using tail calls [#29](Kong/lua-resty-healthcheck#29) * fix: when not providing a hostname, use IP [#48](Kong/lua-resty-healthcheck#48) * fix: makefile; make install * feature: added a status version field [#54](Kong/lua-resty-healthcheck#54) * feature: add headers for probe request [#54](Kong/lua-resty-healthcheck#54) * fix: exit early when reloading during a probe [#47](Kong/lua-resty-healthcheck#47) * fix: prevent target-list from being nil, due to async behaviour [#44](Kong/lua-resty-healthcheck#44) * fix: replace timer and node-wide locks with resty-timer, to prevent interval skips [#59](Kong/lua-resty-healthcheck#59) * change: added additional logging on posting events [#25](Kong/lua-resty-healthcheck#25) * fix: do not run out of timers during init/init_worker when adding a vast amount of targets [#57](Kong/lua-resty-healthcheck#57) * fix: do not call on the module table, but use a method for locks. Also in [#57](Kong/lua-resty-healthcheck#57)
…#44) when two worker create `checker`, `worker-0` first created and add target success, then `worker-1` creating, when `worker-1` call `worker_events:poll()` in line 1408, raise crash. `self.targets` init with empty table avoid this.
when two worker create
checker
,worker-0
first created and add target success, thenworker-1
creating, whenworker-1
callworker_events:poll()
in line 1408, raise crash.self.targets
init with empty table avoid this.