Commit Graph

82 Commits

Author SHA1 Message Date
Nick Elser
6b6eb4e590 Merge pull request #15 from doits/monotonic_time
use monotonic time for retry timeout check
2021-01-21 10:27:46 -08:00
Nick Elser
485f2bff37 Merge pull request #12 from mlarraz/redis_pool
Support connection pooled Redis
2021-01-21 10:25:56 -08:00
Matt Larraz
3a37a74982 Support connection pooled Redis 2021-01-20 16:47:30 -08:00
Nick Elser
b02c256c25 Merge pull request #16 from mlarraz/ruby_versions
Switch to Github Actions and update supported Ruby versions
2021-01-20 16:45:40 -08:00
Matt Larraz
d57f6a15ac Switch to Github Actions and update supported Ruby versions 2021-01-20 16:08:37 -08:00
Markus Doits
6e74322ff1 use monotonic time for retry timeout check 2021-01-07 12:52:21 +01:00
Nick Elser
b9d3f1b7a1 Bump version and update changelog. v0.3.4 2019-09-04 14:36:40 -07:00
Nick Elser
270c05b80e Merge pull request #10 from levkk/levkk/support-pooled-clients
Add support for pooled memcached clients by using #with
2019-09-04 14:33:26 -07:00
Lev Kokotov
60e167e146 relax bundler dependency version 2019-08-22 16:16:57 -07:00
Lev Kokotov
ad08c8b5ea bump Bundler to 2 2019-08-22 16:14:01 -07:00
Lev Kokotov
9b8ef6c244 Add support for pooled memcached clients by using #with 2019-08-22 16:04:14 -07:00
Nick Elser
b8a1d7d9ac Merge pull request #8 from nickelser/update_changelog
Update changelog
v0.3.3
2018-10-05 14:06:42 -07:00
Nick Elser
c58a247156 Run on more modern rubies, as well. 2018-10-05 16:40:25 -04:00
Nick Elser
8c37c24ee6 Merge branch 'master' into update_changelog 2018-10-05 16:31:49 -04:00
Nick Elser
29da8cf090 Add changelog entry, remove spurious gemspec entry. 2018-10-05 16:31:33 -04:00
Nick Elser
8ed488f071 Merge pull request #5 from keylimetoolbox/double-initial-set
Fix #initial_set which is causing a double attempt and delay on lock acquisition and incorrect drop on short acquisition_timeout
2018-10-05 13:28:16 -07:00
Nick Elser
152b6acf9c Merge pull request #7 from nickelser/update_rubocop
Update Rubocop, and bump the version.
2018-10-05 13:25:44 -07:00
Nick Elser
5e10afe534 Update Rubocop, and bump the version. 2018-10-05 16:14:49 -04:00
Nick Elser
0423eb9e12 Merge pull request #6 from GandalftheGUI/ian_remillard/remove_keys_after_last_lock_released
Add 'Time To Live' to mitigate potential memory leak
2018-10-05 13:06:29 -07:00
Ian Remillard
ca46f5f369 add default for expire on set 2018-10-01 10:48:50 -07:00
Ian Remillard
1022a6f9d3 move to expire only when all locks are released 2018-10-01 10:35:30 -07:00
Ian Remillard
6be3a5bdda edits to docs 2018-09-28 16:43:44 -07:00
Ian Remillard
aa4da5d739 update docs for new options 2018-09-28 13:19:01 -07:00
Ian Remillard
fdb0b7f9d5 adds lock ttl and lock_release_removes_key 2018-09-28 12:43:52 -07:00
Jeremy Wadsack
a13edcf7d1 Fix #initial_set which is causing a double attempt and delay on lock acquisition
The call to `#initial_set` in `#retry` and `#acquire_lock` is followed by `next` which leads to a second pass through the `#retry_with_timeout` loop and a sleep call for up to `:acquisition_delay`. This delay isn't necessary if the value can be set without a race condition.

Removing the `next` call causes the client to continue to retry because the transaction has been changed outside the transaction boundary:

In Redis, calling `SET` within a `WATCH`/`UNWATCH` block but not inside a `MULTI`/`EXEC` block will [cause the EXEC to fail the transaction](https://github.com/antirez/redis-doc/issues/734), so the first `#set` call fails and it requires a second pass. To resolve this I changed `#initial_set` to call `#set` within a `MULTI` block so that it would be inside the transaction.

In Memcache the call to `SET` without the `CAS` during `#initial_set` is going to cause the `SET` with `CAS` to fail (return `EXISTS`), and resulting in a second pass. To resolve this I changed `#initial_set` to use `SET` with `CAS` and return the CAS value to be used in the subsequent `#set` call that stores the lock token.
2018-08-30 13:06:16 -07:00
Nick Elser
af1c476f08 Bump version. v0.3.2 2016-10-06 10:22:36 -07:00
Nick Elser
58fae54022 Minor style fixes. 2016-10-06 10:22:29 -07:00
Nick Elser
2088fd90b3 Merge pull request #1 from Shuttlerock/master
Allow to use custom token for lock
2016-10-06 10:20:35 -07:00
Vokhmin Alexey V
05661e143c Allow to use custom token for lock 2016-10-05 13:47:10 +03:00
Nick Elser
a23282dcc6 don't go around allocating empty strings willy-nilly v0.3.1 2015-05-07 00:16:28 -07:00
Nick Elser
323caaee9b update readme v0.3.0 2015-04-15 23:14:06 -07:00
Nick Elser
745d49466f release v0.3.0 2015-04-15 23:11:06 -07:00
Nick Elser
161d50deb9 update tests for new interface 2015-04-15 23:10:34 -07:00
Nick Elser
81e4a3e143 dramatically simpify interface by forcing key at initialization 2015-04-15 23:10:21 -07:00
Nick Elser
2960c14a4d use same language for summary + description 2015-04-13 22:28:42 -07:00
Nick Elser
308e918e60 on second thought, remove confusing language 2015-04-13 22:20:44 -07:00
Nick Elser
aaee69a2df release v0.2.3 2015-04-13 22:15:14 -07:00
Nick Elser
c6d1c29ada add additional deadlock tests 2015-04-13 22:13:15 -07:00
Nick Elser
14e442e99d remove semaphore language and clarify language 2015-04-13 22:13:07 -07:00
Nick Elser
498073b92e tiny code style improvements 2015-04-13 21:55:34 -07:00
Nick Elser
155a3ac40c release v0.2.2 v0.2.2 2015-04-13 21:45:47 -07:00
Nick Elser
10d3ab09cf handle invalid lock data 2015-04-13 21:40:54 -07:00
Nick Elser
2724ec6d9d add another test case for the nil refresh case 2015-04-13 21:32:01 -07:00
Nick Elser
185327f59c fix documentation and add another test for refresh 2015-04-13 21:21:45 -07:00
Nick Elser
c8a972da31 more tests for (still not great) refresh method 2015-04-13 20:29:23 -07:00
Nick Elser
7591c08a28 avoid name collision for locks method 2015-04-13 20:29:03 -07:00
Nick Elser
1dee338e16 slightly more coverage 2015-04-13 19:42:50 -07:00
Nick Elser
900c723043 only report to codeclimate when credentials passed in 2015-04-13 19:37:58 -07:00
Nick Elser
6e2afdf80a add tests for refresh and slight refactor 2015-04-13 19:37:49 -07:00
Nick Elser
49a9757d44 fix refresh token 2015-04-13 19:37:34 -07:00