redis_queued_locks 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +17 -8
- data/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock.rb +5 -3
- data/lib/redis_queued_locks/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43854a2842911dcf40e95329b2631bc6c76cdaff0cd204fb57eff55c0ee461aa
|
4
|
+
data.tar.gz: c361d55a71ac4c71d307fca4a7182069d055e302ec7b65274bcbc1a4ede6f768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6887f12891fce49f878427b501980695872e304c1429331d23b251d2f66f2db1f07a0994952f0b4ad6d9ec9b81ea769eaefe09ab1bef0c1abcadc9770ef38344
|
7
|
+
data.tar.gz: aa2f6d2cfbe72dd6bf5c637f5538ce1df7c8415579505f765b3016a4c243abc52cd1db246f51abba7efa51abef123d577e26bfee992a5484208cb1416ca00f50
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.0.33] - 2024-03-26
|
4
|
+
### Added
|
5
|
+
- Logging: added current lock data info to the detailed `#try_to_lock` log to the cases when lock is still obtained. It is suitable
|
6
|
+
when you pass a custom metadata with lock obtainer (for example: the current string of code) and want to see this information
|
7
|
+
in logs when you can not acquire the concrete lock long time;
|
8
|
+
|
3
9
|
## [0.0.32] - 2024-03-26
|
4
10
|
### Added
|
5
11
|
- Support for custom metadata that merged to the lock data. This data also returned from `RedisQueudLocks::Client#lock_info` method;
|
data/README.md
CHANGED
@@ -140,18 +140,27 @@ clinet = RedisQueuedLocks::Client.new(redis_client) do |config|
|
|
140
140
|
# (default: RedisQueuedLocks::Logging::VoidLogger)
|
141
141
|
# - the logger object;
|
142
142
|
# - should implement `debug(progname = nil, &block)` (minimal requirement) or be an instance of Ruby's `::Logger` class/subclass;
|
143
|
-
# - at this moment the only debug logs are realised in
|
144
|
-
# -
|
145
|
-
# -
|
146
|
-
# -
|
143
|
+
# - at this moment the only debug logs are realised in following cases:
|
144
|
+
# - "[redis_queued_locks.start_lock_obtaining]" (logs "lock_key", "queue_ttl", "acq_id");
|
145
|
+
# - "[redis_queued_locks.start_try_to_lock_cycle]" (logs "lock_key", "queue_ttl", "acq_id");
|
146
|
+
# - "[redis_queued_locks.dead_score_reached__reset_acquier_position]" (logs "lock_key", "queue_ttl", "acq_id");
|
147
|
+
# - "[redis_queued_locks.lock_obtained]" (logs "lockkey", "queue_ttl", "acq_id", "acq_time");
|
147
148
|
# - by default uses VoidLogger that does nothing;
|
148
149
|
config.logger = RedisQueuedLocks::Logging::VoidLogger
|
149
150
|
|
150
151
|
# (default: false)
|
151
|
-
# -
|
152
|
-
# -
|
153
|
-
#
|
154
|
-
# -
|
152
|
+
# - adds additional debug logs;
|
153
|
+
# - enables additional logs for each internal try-retry lock acquiring (a lot of logs can be generated depending on your retry configurations);
|
154
|
+
# - it adds following logs in addition to the existing:
|
155
|
+
# - "[redis_queued_locks.try_lock.start]" (logs "lock_key", "queue_ttl", "acq_id");
|
156
|
+
# - "[redis_queued_locks.try_lock.rconn_fetched]" (logs "lock_key", "queue_ttl", "acq_id");
|
157
|
+
# - "[redis_queued_locks.try_lock.acq_added_to_queue]" (logs "lock_key", "queue_ttl", "acq_id)";
|
158
|
+
# - "[redis_queued_locks.try_lock.remove_expired_acqs]" (logs "lock_key", "queue_ttl", "acq_id");
|
159
|
+
# - "[redis_queued_locks.try_lock.get_first_from_queue]" (logs "lock_key", "queue_ttl", "acq_id", "first_acq_id_in_queue");
|
160
|
+
# - "[redis_queued_locks.try_lock.exit__queue_ttl_reached]" (logs "lock_key", "queue_ttl", "acq_id");
|
161
|
+
# - "[redis_queued_locks.try_lock.exit__no_first]" (logs "lock_key", "queue_ttl", "acq_id", "first_acq_id_in_queue", "<current_lock_data>");
|
162
|
+
# - "[redis_queued_locks.try_lock.exit__still_obtained]" (logs "lock_key", "queue_ttl", "acq_id", "first_acq_id_in_queue", "locked_by_acq_id", "<current_lock_data>");
|
163
|
+
# - "[redis_queued_locks.try_lock.run__free_to_acquire]" (logs "lock_key", "queue_ttl", "acq_id");
|
155
164
|
# - if logger is not configured this option does not lead to any effect;
|
156
165
|
config.log_lock_try = false
|
157
166
|
end
|
@@ -46,7 +46,7 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
|
|
46
46
|
"[redis_queued_locks.try_lock.start] " \
|
47
47
|
"lock_key => '#{lock_key}' " \
|
48
48
|
"queue_ttl => #{queue_ttl} " \
|
49
|
-
"acq_id => '#{acquier_id}'
|
49
|
+
"acq_id => '#{acquier_id}'"
|
50
50
|
)
|
51
51
|
end
|
52
52
|
end
|
@@ -163,7 +163,8 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
|
|
163
163
|
"lock_key => '#{lock_key}' " \
|
164
164
|
"queue_ttl => #{queue_ttl} " \
|
165
165
|
"acq_id => '#{acquier_id}' " \
|
166
|
-
"first_acq_id_in_queue => '#{waiting_acquier}'"
|
166
|
+
"first_acq_id_in_queue => '#{waiting_acquier}' " \
|
167
|
+
"<current_lock_data> => <<#{rconn.call('HGETALL', lock_key).to_h}>>"
|
167
168
|
)
|
168
169
|
end
|
169
170
|
end
|
@@ -199,7 +200,8 @@ module RedisQueuedLocks::Acquier::AcquireLock::TryToLock
|
|
199
200
|
"queue_ttl => #{queue_ttl} " \
|
200
201
|
"acq_id => '#{acquier_id}' " \
|
201
202
|
"first_acq_id_in_queue => '#{waiting_acquier}' " \
|
202
|
-
"locked_by_acq_id => '#{locked_by_acquier}'"
|
203
|
+
"locked_by_acq_id => '#{locked_by_acquier}' " \
|
204
|
+
"<current_lock_data> => <<#{rconn.call('HGETALL', lock_key).to_h}>>"
|
203
205
|
)
|
204
206
|
end
|
205
207
|
end
|