Commit Graph

74 Commits

Author SHA1 Message Date
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
Nick Elser
754d7d8faf report test coverage 2015-04-13 10:12:26 -07:00
Nick Elser
857fc63378 release 0.2.1 v0.2.1 2015-04-12 23:45:09 -07:00
Nick Elser
bb6762bbc6 ret is not always an array 2015-04-12 23:45:00 -07:00
Nick Elser
f0977c89f2 remove redundant require file 2015-04-12 23:03:54 -07:00
Nick Elser
4d5c96309f some style fixes 2015-04-12 22:54:53 -07:00
Nick Elser
8d6061b137 rename some tests, fix rare edge condition 2015-04-12 22:49:02 -07:00
Nick Elser
ce0a4d8d86 release 0.2.0 v0.2.0 2015-04-12 22:33:19 -07:00
Nick Elser
1fd769eec2 refactor class methods into instance methods 2015-04-12 22:32:51 -07:00