Skip to content

Dev/repair#141

Merged
lzsweb merged 6 commits into
mainfrom
dev/repair
Jun 16, 2026
Merged

Dev/repair#141
lzsweb merged 6 commits into
mainfrom
dev/repair

Conversation

@luk384090-cloud

Copy link
Copy Markdown
Collaborator

Description

[Describe what this PR does and why]

Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Model
  • Application
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes thread-locking mechanisms from the shared asynchronous session management and introduces exception handling blocks around HTTP request handlers. However, removing the thread lock introduces potential race conditions in multi-threaded environments when accessing the shared SSL context and sessions. Additionally, catching BaseException in generator functions is an anti-pattern as it intercepts system-exiting exceptions and GeneratorExit (which is raised when iteration is stopped early). Finally, catching ClientConnectorError is redundant since it already inherits from Exception. It is recommended to restore the thread locks and simplify the exception handling to catch only Exception.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread dashscope/api_entities/aio_session.py
Comment thread dashscope/api_entities/aio_session.py
Comment thread dashscope/api_entities/aio_session.py Outdated
Comment thread dashscope/api_entities/aio_session.py Outdated
Comment thread dashscope/api_entities/http_request.py Outdated
Comment thread dashscope/api_entities/http_request.py Outdated
Comment thread dashscope/api_entities/aiohttp_request.py Outdated
kevin and others added 4 commits June 15, 2026 19:12
…e_shared_aio_session

- Add optional `session` parameter to AioHttpRequest.__init__ for injecting
  external aiohttp.ClientSession (aligned with HttpRequest)
- Add should_close lifecycle pattern to async request handlers in both
  AioHttpRequest and HttpRequest (consistent with sync _handle_request)
- Export close_shared_aio_session from dashscope package for explicit
  connection pool cleanup

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lzsweb lzsweb merged commit 54f65bf into main Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants