Skip to content

Close sessions: monkey patch#676

Merged
cyc60 merged 5 commits intomasterfrom
patch-web3py
Mar 4, 2026
Merged

Close sessions: monkey patch#676
cyc60 merged 5 commits intomasterfrom
patch-web3py

Conversation

@cyc60
Copy link
Copy Markdown
Contributor

@cyc60 cyc60 commented Mar 3, 2026

No description provided.

Signed-off-by: cyc60 <avsysoev60@gmail.com>
Copilot AI review requested due to automatic review settings March 3, 2026 10:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a targeted workaround for web3.py aiohttp session eviction so the operator can force-close any lingering (background) HTTP sessions during shutdown, replacing the previous “sleep to wait for cleanup” approach.

Changes:

  • Introduces a web3.py internal monkey patch that tracks evicted aiohttp.ClientSession instances and exposes close_evicted_sessions().
  • Updates client shutdown to force-close any tracked evicted sessions instead of sleeping.
  • Simplifies shutdown call sites to use the new close_clients() signature.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/common/web3.py Adds monkey patch + tracking set and a shutdown hook to close lingering evicted aiohttp sessions.
src/common/clients.py Removes the optional sleep-based shutdown delay and always calls close_evicted_sessions() during shutdown.
src/commands/start/base.py Updates shutdown call to match the new close_clients() signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cyc60 added 2 commits March 3, 2026 13:46
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Copilot AI review requested due to automatic review settings March 3, 2026 15:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cyc60 added 2 commits March 3, 2026 21:01
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Copilot AI review requested due to automatic review settings March 3, 2026 18:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cyc60 cyc60 merged commit fa1f82b into master Mar 4, 2026
12 checks passed
@cyc60 cyc60 deleted the patch-web3py branch March 4, 2026 08:30
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.

3 participants