Module: RedisQueuedLocks::Acquirer::AcquireLock::TryToLock::LogVisitor Private

Defined in:
lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

rubocop:disable Metrics/ModuleLength

Since:

  • 1.7.0

Class Method Summary collapse

Class Method Details

.acq_added_to_queue(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 291

def acq_added_to_queue(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.acq_added_to_queue] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.exit__lock_still_obtained(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, waiting_acquirer, locked_by_acquirer, current_lock_data) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • waiting_acquirer (String, NilClass)
  • locked_by_acquirer (String)
  • current_lock_data (Hash<String,Any>)

Since:

  • 1.7.0

Version:

  • 1.9.0



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 478

def exit__lock_still_obtained(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  waiting_acquirer,
  locked_by_acquirer,
  current_lock_data
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.exit__lock_still_obtained] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "first_acq_id_in_queue => '#{waiting_acquirer}' " \
    "locked_by_acq_id => '#{locked_by_acquirer}' " \
    "<current_lock_data> => <<#{current_lock_data}>>"
  end rescue nil
end

.exit__no_first(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, waiting_acquirer, current_lock_data) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • waiting_acquirer (String, NilClass)
  • current_lock_data (Hash<String,Any>)

Since:

  • 1.7.0

Version:

  • 1.9.0



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 436

def exit__no_first(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  waiting_acquirer,
  current_lock_data
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.exit__no_first] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "first_acq_id_in_queue => '#{waiting_acquirer}' " \
    "<current_lock_data> => <<#{current_lock_data}>>"
  end rescue nil
end

.exit__queue_ttl_reached(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 399

def exit__queue_ttl_reached(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.exit__queue_ttl_reached] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.get_first_from_queue(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, waiting_acquirer) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • waiting_acquirer (String, NilClass)

Since:

  • 1.7.0

Version:

  • 1.9.0



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 362

def get_first_from_queue(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  waiting_acquirer
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.get_first_from_queue] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "first_acq_id_in_queue => '#{waiting_acquirer}'"
  end rescue nil
end

.obtain__free_to_acquire(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 519

def obtain__free_to_acquire(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.obtain__free_to_acquire] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.rconn_fetched(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 57

def rconn_fetched(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.rconn_fetched] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.reentrant_lock__extend_and_work_through(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, sp_conflict_status, ttl, spc_processed_timestamp) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • sp_conflict_status (Symbol)
  • ttl (Integer)
  • spc_processed_timestamp (Float)

Since:

  • 1.7.0

Version:

  • 1.9.0



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 168

def reentrant_lock__extend_and_work_through(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  sp_conflict_status,
  ttl,
  spc_processed_timestamp
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.reentrant_lock__extend_and_work_through] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "spc_status => '#{sp_conflict_status}' " \
    "last_ext_ttl => #{ttl} " \
    "last_ext_ts => '#{spc_processed_timestamp}'"
  end rescue nil
end

.reentrant_lock__work_through(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, sp_conflict_status, spc_processed_timestamp) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • sp_conflict_status (Symbol)
  • spc_processed_timestamp (Float)

Since:

  • 1.7.0

Version:

  • 1.9.0



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 211

def reentrant_lock__work_through(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  sp_conflict_status,
  spc_processed_timestamp
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.reentrant_lock__work_through] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "spc_status => '#{sp_conflict_status}' " \
    "last_spc_ts => '#{spc_processed_timestamp}'"
  end rescue nil
end

.remove_expired_acqs(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 326

def remove_expired_acqs(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.remove_expired_acqs] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.same_process_conflict_analyzed(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, sp_conflict_status) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • sp_conflict_status (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 128

def same_process_conflict_analyzed(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  sp_conflict_status
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.same_process_conflict_analyzed] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "spc_status => '#{sp_conflict_status}'"
  end rescue nil
end

.same_process_conflict_detected(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 92

def same_process_conflict_detected(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.same_process_conflict_detected] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end

.single_process_lock_conflict__dead_lock(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy, sp_conflict_status, spc_processed_timestamp) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)
  • sp_conflict_status (Symbol)
  • spc_processed_timestamp (Float)

Since:

  • 1.7.0

Version:

  • 1.9.0



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 252

def single_process_lock_conflict__dead_lock(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy,
  sp_conflict_status,
  spc_processed_timestamp
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.single_process_lock_conflict__dead_lock] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}' " \
    "spc_status => '#{sp_conflict_status}' " \
    "last_spc_ts => '#{spc_processed_timestamp}'"
  end rescue nil
end

.start(logger, log_sampled, log_lock_try, lock_key, queue_ttl, acquirer_id, host_id, access_strategy) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • logger (::Logger, #debug)
  • log_sampled (Boolean)
  • log_lock_try (Boolean)
  • lock_key (String)
  • queue_ttl (Integer)
  • acquirer_id (String)
  • host_id (String)
  • access_strategy (Symbol)

Since:

  • 1.7.0

Version:

  • 1.9.0



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb', line 22

def start(
  logger,
  log_sampled,
  log_lock_try,
  lock_key,
  queue_ttl,
  acquirer_id,
  host_id,
  access_strategy
)
  return unless log_sampled && log_lock_try

  logger.debug do
    "[redis_queued_locks.try_lock.start] " \
    "lock_key => '#{lock_key}' " \
    "queue_ttl => #{queue_ttl} " \
    "acq_id => '#{acquirer_id}' " \
    "hst_id => '#{host_id}' " \
    "acs_strat => '#{access_strategy}'"
  end rescue nil
end