Skip to content

update to 251#1

Merged
jeffparsons merged 8 commits intomainfrom
update_to_251
Apr 10, 2025
Merged

update to 251#1
jeffparsons merged 8 commits intomainfrom
update_to_251

Conversation

@alexf101
Copy link
Copy Markdown

@alexf101 alexf101 commented Apr 9, 2025

Changes from upstream:

Our change:

  • Non-blocking connection creation

ttstarck and others added 7 commits April 10, 2025 14:46
* Add idle and reap methods to connection pool

* Change ConnectionPool#reap idle_seconds default value from 0 to 60

0 seconds is on the aggresive, setting to a more sane value of 60 seconds to prevent connection reaping/creation thrash.

* Update README with information on new ConnectionPool methods #reap and #idle

* add section to README about creating a reaper thread
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
While default autofix is handy, the configuration makes it so that auto-fixable issues don't trigger a CI failure
* Fix reaper exhausting the queue

After max queue size connections have been reaped, no new connections are allowed to be created.

* Reduce contention on the stack mutex

The connection shutdown block can safely happen outside the mutex. This allows another thread to safely grab a connection while the reaper is still working through old connections.

* Handle stack shutdown in reap
* Add test cases for reload that assert connections are not created if at the connection pool size

The TimedStack class currently allows

* Ensure TimedStack does not create more connections than max size even after reload.

* remove decrement_created method in favor of inline

* add test case to ensure shutdown and reap can be called after errors
Create connections while not holding the mutex so that multiple connections can be created at once, and so that any slowdown with making connections doesn't stop existing connections from being used. We optimistically treat the connection as created (by incrementing `@created`) so it's still impossible to create more than the max number of connections.

This should ensure that the existing connections remain accessible even while a new connection is being created.

Original author: drp@stileeducaiton.com

Rebased by Alex and removed formatting discrepancy. Please do NOT auto-format this file to avoid needing to manually reconcile future pulls.
@jeffparsons jeffparsons merged commit 863b875 into main Apr 10, 2025
0 of 18 checks passed
@jeffparsons jeffparsons deleted the update_to_251 branch April 10, 2025 05:04
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.

5 participants