Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.97.0"
".": "1.97.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 214
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-57a965663739666faa0c7699e48af1185389436a2c4fd774e28d86cb7b1c69ba.yml
openapi_spec_hash: cd4681291bf755562f76ae6a1ead73a3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-878472ce6c3df1541bd6f2924ca987acc43fec7409cb06e6fe129638f9b6fb72.yml
openapi_spec_hash: 69facc862aa08df8ca458569028663e7
config_hash: a143293c5450ae8f52acad08f3102575
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.97.1 (2025-09-30)

Full Changelog: [v1.97.0...v1.97.1](https://github.com/Increase/increase-ruby/compare/v1.97.0...v1.97.1)

### Bug Fixes

* coroutine leaks from connection pool ([78dc815](https://github.com/Increase/increase-ruby/commit/78dc8152fc1d9ca7f849cf0d9cce6c49e5d80f96))

## 1.97.0 (2025-09-29)

Full Changelog: [v1.96.0...v1.97.0](https://github.com/Increase/increase-ruby/compare/v1.96.0...v1.97.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
increase (1.97.0)
increase (1.97.1)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "increase", "~> 1.97.0"
gem "increase", "~> 1.97.1"
```

<!-- x-release-please-end -->
Expand Down
17 changes: 7 additions & 10 deletions lib/increase/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def execute(request)

# rubocop:disable Metrics/BlockLength
enum = Enumerator.new do |y|
with_pool(url, deadline: deadline) do |conn|
next if finished
next if finished

with_pool(url, deadline: deadline) do |conn|
req, closing = self.class.build_request(request) do
self.class.calibrate_socket_timeout(conn, deadline)
end
Expand All @@ -149,7 +149,7 @@ def execute(request)

self.class.calibrate_socket_timeout(conn, deadline)
conn.request(req) do |rsp|
y << [conn, req, rsp]
y << [req, rsp]
break if finished

rsp.read_body do |bytes|
Expand All @@ -160,6 +160,8 @@ def execute(request)
end
eof = true
end
ensure
conn.finish if !eof && conn&.started?
end
rescue Timeout::Error
raise Increase::Errors::APITimeoutError.new(url: url, request: req)
Expand All @@ -168,16 +170,11 @@ def execute(request)
end
# rubocop:enable Metrics/BlockLength

conn, _, response = enum.next
_, response = enum.next
body = Increase::Internal::Util.fused_enum(enum, external: true) do
finished = true
tap do
enum.next
rescue StopIteration
nil
end
loop { enum.next }
ensure
conn.finish if !eof && conn&.started?
closing&.call
end
[Integer(response.code), response, body]
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Increase
VERSION = "1.97.0"
VERSION = "1.97.1"
end
25 changes: 25 additions & 0 deletions test/increase/internal/util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,31 @@ def test_copy_write
end

class Increase::Test::UtilFusedEnumTest < Minitest::Test
def test_rewind_closing
touched = false
once = 0
steps = 0
enum = Enumerator.new do |y|
next if touched

10.times do
steps = _1
y << _1
end
ensure
once = once.succ
end

fused = Increase::Internal::Util.fused_enum(enum, external: true) do
touched = true
loop { enum.next }
end
Increase::Internal::Util.close_fused!(fused)

assert_equal(1, once)
assert_equal(0, steps)
end

def test_closing
arr = [1, 2, 3]
once = 0
Expand Down