Skip to content

Fix Seahorse::Client::NetHttp::ConnectionPool::ExtendedSession unused block warning #3178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
bkuhlmann opened this issue Feb 1, 2025 · 2 comments · Fixed by #3185
Closed
1 task
Assignees
Labels
bug This issue is a bug.

Comments

@bkuhlmann
Copy link

bkuhlmann commented Feb 1, 2025

Describe the bug

Hello. 👋 I'm getting the following warning in my console:

$HOME/.cache/frum/versions/3.4.1/lib/ruby/3.4.0/delegate.rb:84: warning: the block passed to 'Seahorse::Client::NetHttp::ConnectionPool::ExtendedSession#__getobj__' defined at $HOME/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/aws-sdk-core-3.217.1/lib/seahorse/client/net_http/connection_pool.rb:338 may be ignored

The problem is that a block is being passed to the response when it shouldn't because the response doesn't use a block. This is similar to the issue that was addressed in 3169.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I would expect this error to not show up since the block is never used/implemented in the code.

Current Behavior

See above.

Reproduction Steps

I believe if you add this line to your test suite, you'll see the warning show up immediately:

Warning[:strict_unused_block] = true

Possible Solution

You could change your method signature as follows:

class ExtendedSession < Delegator
  # Truncated for brevity...

  def __getobj__(&)
    @http
  end

  # Truncated for brevity...
end

Use of the anonymous block should correct the issue.

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-core

Environment details (Version of Ruby, OS environment)

ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin24.2.0]

@bkuhlmann bkuhlmann added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 1, 2025
@mullermp mullermp removed the needs-triage This issue or PR still needs to be triaged. label Feb 3, 2025
Copy link

github-actions bot commented Feb 6, 2025

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@richardwang1124
Copy link
Contributor

Hello! Thank you for bringing this issue to our attention. We have merged a fix for this issue and it will be part of tomorrow's release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants