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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/yiffspace/concerns/concurrency_methods.rb +7 -3
- data/lib/yiffspace/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcc7debaf3de27ae727e1ff742fd67eda285f06cf098d623968298bf4ef5f32c
|
|
4
|
+
data.tar.gz: b17224bbb3249295b7f08132bf66c0c45770d638f5918909611e8d175d383afc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
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.
|
|
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-
|
|
10
|
+
date: 2026-10-27 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: abbrev
|