Skip to content

Commit

Permalink
release 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
locao committed Jul 7, 2022
1 parent e434007 commit 8277401
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 5 deletions.
69 changes: 68 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h1>lua-resty-healthcheck</h1>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Node_management">Node management </a></li>
<li><a href="#Health_management">Health management </a></li>
Expand Down Expand Up @@ -79,6 +80,16 @@ <h3>Info:</h3>
</ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#run_locked">run_locked (self, key, fn, ...)</a></td>
<td class="summary">Acquire a lock and run a function</p>

<p> The function call itself is wrapped with <a href="https://www.lua.org/manual/5.1/manual.html#pdf-pcall">pcall</a> to protect against
exception.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
Expand Down Expand Up @@ -160,6 +171,62 @@ <h2><a href="#Initializing">Initializing </a></h2>
<br/>


<h2 class="section-header "><a name="Functions"></a>Functions</h2>

<dl class="function">
<dt>
<a name = "run_locked"></a>
<strong>run_locked (self, key, fn, ...)</strong>
</dt>
<dd>

<p>Acquire a lock and run a function</p>

<p> The function call itself is wrapped with <a href="https://www.lua.org/manual/5.1/manual.html#pdf-pcall">pcall</a> to protect against
exception. </p>

<p> This function exhibits some special behavior when called during a
non-yieldable phase such as <code>init_worker</code> or <code>log</code>:</p>

<ol>
<li>The lock timeout is set to 0 to ensure that <code>resty.lock</code> does not
attempt to sleep/yield</li>
<li>If acquiring the lock fails due to a timeout, <a href="index.html#run_locked">run_locked</a>
(this function) is re-scheduled to run in a timer. In this case,
the function returns <code>&quot;scheduled&quot;</code></li>
</ol>




<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
The checker object
</li>
<li><span class="parameter">key</span>
the key/identifier to acquire a lock for
</li>
<li><span class="parameter">fn</span>
The function to execute
</li>
<li><span class="parameter">...</span>
arguments that will be passed to fn
</li>
</ul>

<h3>Returns:</h3>
<ol>

The results of the function; or nil and an error message
in case it fails locking.
</ol>




</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>

<dl class="function">
Expand Down Expand Up @@ -763,7 +830,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-03-23 17:29:48 </i>
<i style="float:right;">Last updated 2022-07-07 16:50:48 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
30 changes: 27 additions & 3 deletions docs/topics/readme.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ <h2>Modules</h2>

<h1>lua-resty-healthcheck</h1>

<p><a href="https://travis-ci.org/Kong/lua-resty-healthcheck/branches"><img src="https://travis-ci.org/Kong/lua-resty-healthcheck.svg?branch=master" alt="Build Status"/></a></p>
<p><img src="https://img.shields.io/luarocks/v/kong/lua-resty-healthcheck/1.5.2-1?style=flat-square" alt="legacy version"/>
<img src="https://github.com/Kong/lua-resty-healthcheck/actions/workflows/latest_os.yml/badge.svg?branch=release/1.5.x" alt="Release 1.5.x"/>
<img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square" alt="License"/>
<img src="https://img.shields.io/twitter/follow/thekonginc?style=social" alt="Twitter Follow"/></p>

<p>A health check library for OpenResty.</p>

Expand Down Expand Up @@ -145,6 +148,20 @@ <h2>History</h2>

<p>Versioning is strictly based on <a href="https://semver.org/">Semantic Versioning</a></p>

<h3>1.5.2 (07-Jul-2022)</h3>

<ul>
<li>Better handling of <code>resty.lock</code> failure modes, adding more checks to ensure the
lock is held before running critical code, and improving the decision whether a
function should be retried after a timeout trying to acquire a lock.
<a href="https://github.com/Kong/lua-resty-healthcheck/pull/113">#113</a></li>
<li>Increased logging for locked function failures.
<a href="https://github.com/Kong/lua-resty-healthcheck/pull/114">#114</a></li>
<li>The cleanup frequency of deleted targets was lowered, cutting the number of
created locks in a short period.
<a href="https://github.com/Kong/lua-resty-healthcheck/pull/116">#116</a></li>
</ul>

<h3>1.5.1 (23-Mar-2022)</h3>

<ul>
Expand All @@ -163,6 +180,13 @@ <h3>1.5.0 (09-Feb-2022)</h3>
<a href="https://github.com/Kong/lua-resty-healthcheck/pull/88">#88</a></li>
</ul>

<h3>1.4.3 (31-Mar-2022)</h3>

<ul>
<li>Fix: avoid breaking active health checks when adding or removing targets.
<a href="https://github.com/Kong/lua-resty-healthcheck/pull/100">#100</a></li>
</ul>

<h3>1.4.2 (29-Jun-2021)</h3>

<ul>
Expand Down Expand Up @@ -306,7 +330,7 @@ <h3>0.1.0 (27-Nov-2017) Initial release</h3>
<p><a name="Copyright_and_License"></a></p>
<h2>Copyright and License</h2>

<pre><code> Copyright 2017-2021 Kong Inc.
<pre><code> Copyright 2017-2022 Kong Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -328,7 +352,7 @@ <h2>Copyright and License</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-03-23 17:29:48 </i>
<i style="float:right;">Last updated 2022-07-07 16:50:48 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lua-resty-healthcheck

![legacy version](https://img.shields.io/luarocks/v/kong/lua-resty-healthcheck/1.5.1-1?style=flat-square)
![legacy version](https://img.shields.io/luarocks/v/kong/lua-resty-healthcheck/1.5.2-1?style=flat-square)
![Release 1.5.x](https://github.com/Kong/lua-resty-healthcheck/actions/workflows/latest_os.yml/badge.svg?branch=release/1.5.x)
![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square)
![Twitter Follow](https://img.shields.io/twitter/follow/thekonginc?style=social)
Expand Down Expand Up @@ -91,6 +91,18 @@ for the complete API.

Versioning is strictly based on [Semantic Versioning](https://semver.org/)

### 1.5.2 (07-Jul-2022)

* Better handling of `resty.lock` failure modes, adding more checks to ensure the
lock is held before running critical code, and improving the decision whether a
function should be retried after a timeout trying to acquire a lock.
[#113](https://github.com/Kong/lua-resty-healthcheck/pull/113)
* Increased logging for locked function failures.
[#114](https://github.com/Kong/lua-resty-healthcheck/pull/114)
* The cleanup frequency of deleted targets was lowered, cutting the number of
created locks in a short period.
[#116](https://github.com/Kong/lua-resty-healthcheck/pull/116)

### 1.5.1 (23-Mar-2022)

* Fix: avoid breaking active health checks when adding or removing targets.
Expand Down
27 changes: 27 additions & 0 deletions rockspecs/lua-resty-healthcheck-1.5.2-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package = "lua-resty-healthcheck"
version = "1.5.2-1"
source = {
url = "https://github.com/Kong/lua-resty-healthcheck/archive/1.5.2.tar.gz",
dir = "lua-resty-healthcheck-1.5.2"
}
description = {
summary = "Healthchecks for OpenResty to check upstream service status",
detailed = [[
lua-resty-healthcheck is a module that can check upstream service
availability by sending requests and validating responses at timed
intervals.
]],
license = "Apache 2.0",
homepage = "https://github.com/Kong/lua-resty-healthcheck"
}
dependencies = {
"lua-resty-worker-events == 1.0.0",
"penlight >= 1.9.2",
"lua-resty-timer ~> 1",
}
build = {
type = "builtin",
modules = {
["resty.healthcheck"] = "lib/resty/healthcheck.lua",
}
}

0 comments on commit 8277401

Please sign in to comment.