-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lock) handle all resty.lock failure modes (#112)
* fix(lock) handle all resty.lock failure modes This fixes a bug in the `run_fn_locked_target_list` function. The function wraps `resty.lock:lock()` with pcall, but it was only checking the pcall return status and not the actual result of the lock operation. Therefore it would continue even if no lock was acquired. Additionally, I expanded the error-handling to explicitly check for known errors returned by `resty.lock:lock()` ("timeout" and "locked"). This ensures that we only retry the function if the lock operation failed in a recoverable way. * refactor(lock) use special run_locked helper * fix(healthchecker) handle fetch_target_list failure in checker callback * refactor(lock) don't return function value in timer * fix(lock) change run_locked return signature when rescheduling * fix(lock) fix return check conditional * chore(*) revert a docstring change * chore(*) re-organize dependencies and cached locals * chore(lock) add explanation for resty_lock's limited scope
- Loading branch information
Showing
1 changed file
with
162 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters