yiffspace-core 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9e70befbca65b0155e1a317149268f3c4b88812312e6c382c331d306b04816e
4
- data.tar.gz: 2bf60d4c568ac65d5dc97a6699b6f5d4e94a9066d9d4d7f3bd5808a3481b03d6
3
+ metadata.gz: dcc7debaf3de27ae727e1ff742fd67eda285f06cf098d623968298bf4ef5f32c
4
+ data.tar.gz: b17224bbb3249295b7f08132bf66c0c45770d638f5918909611e8d175d383afc
5
5
  SHA512:
6
- metadata.gz: 86cc77b00d1b2308afddd100d3cc20ad8194669bb0e030ea2e44763e798c703560b321a58162b4acd09d5502777fde4283f57e981d5dcc7662dd5932037c8a77
7
- data.tar.gz: a77cb9429d123a90b4d290934a453d55790c2978c50a03cdacb4804eb70dddfb6afd05ba9e38cb404b250f0b848e03dda36190044b81af697e5c6a28017906b6
6
+ metadata.gz: 6a84fcebd3d24a033798cd6f02d1e69aa8cdf0679bafea7f2987ff66cb849b858d18367db016d4bf23a93e01975e1bbc5b373eb186c354594bcdf458d43a7b87
7
+ data.tar.gz: da3e8a6557800d1c1259f6bf998fc8b52b79f8c2e4848729166a3667f16d1d28acb21f8661481071b716dc06bcf5f9b7e8287d4e8d6386cd9f5a381f13bf4b93
data/CHANGELOG.md CHANGED
@@ -44,6 +44,13 @@
44
44
  not just to callers going through it directly - a helper that itself calls
45
45
  `some_path(...)` (with no receiver) now works the same way it would from a
46
46
  real view, instead of raising `NoMethodError`.
47
+ - Fixed `parallel_find_each` exhausting the connection pool: records run on
48
+ concurrent-ruby's shared `:io` pool, whose threads never exit, so any plain
49
+ `connection` call inside the block leased a connection to that thread for
50
+ good. Once enough threads held one, every other record waited out the pool
51
+ timeout and raised `ActiveRecord::ConnectionTimeoutError`. Each record now
52
+ runs inside `with_connection(prevent_permanent_checkout: true)`, which
53
+ returns the connection when the block finishes.
47
54
 
48
55
  ## 0.1.0
49
56
 
@@ -6,12 +6,16 @@ module YiffSpace
6
6
  extend(ActiveSupport::Concern)
7
7
 
8
8
  class_methods do
9
- def parallel_find_each(**, &)
9
+ def parallel_find_each(**, &block)
10
10
  # XXX We may deadlock if a transaction is open; do a non-parallel each.
11
- return find_each(&) if connection.transaction_open?
11
+ return find_each(&block) if connection.transaction_open?
12
12
 
13
13
  find_in_batches(error_on_ignore: true, **) do |batch|
14
- batch.parallel_each(&)
14
+ # The pool threads are shared and never finish, so a connection leased on one (any plain
15
+ # `connection` call) would be held forever, starving the rest. Return it after each record
16
+ batch.parallel_each do |record|
17
+ connection_pool.with_connection(prevent_permanent_checkout: true) { block.call(record) }
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module YiffSpace
4
4
  module Core
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yiffspace-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan_DMC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-04 00:00:00.000000000 Z
10
+ date: 2026-10-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: abbrev