Skip to content

icap-client: simplify ICAP connection pooling - #106

Merged
DanielHaimanot merged 2 commits into
mainfrom
icap_conn_pool
Sep 17, 2026
Merged

DanielHaimanot merged 2 commits into
mainfrom
icap_conn_pool

Conversation

@DanielHaimanot

Copy link
Copy Markdown
Contributor

Reworks the ICAP connection pool to make reuse simpler.

Main changes:

  • LIFO reuse for idle connections
  • probe connections before reuse
  • min/max idle pool sizing
  • idle connection expiry + background refill
  • options request application timeout
  • added related tests

No change to the proxy existing ICAP capability/OPTIONS semantics. Connection refill happens outside the idle pool lock.

Note: some test code was created with AI assistance and manually reviewed.

@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.38710% with 98 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/vey-icap-client/src/service/pool/bench.rs 0.00% 81 Missing ⚠️
lib/vey-icap-client/src/service/pool.rs 88.23% 10 Missing ⚠️
lib/vey-icap-client/src/service/config/yaml.rs 20.00% 4 Missing ⚠️
lib/vey-icap-client/src/service/config/mod.rs 25.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread lib/vey-icap-client/src/service/client.rs Outdated
Comment thread lib/vey-icap-client/src/service/connection.rs Outdated
Comment thread lib/vey-icap-client/src/service/pool.rs
Comment thread lib/vey-icap-client/src/service/pool.rs Outdated
Comment thread lib/vey-icap-client/Cargo.toml Outdated
config: Arc<IcapServiceConfig>,
options: Arc<IcapServiceOptions>,
options: ArcSwap<IcapServiceOptions>,
idle_pool: Mutex<VecDeque<IdleIcapConnection>>,

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.

could this lock be sharded by worker id? The similar has been done in site http1 connection poll(but not tested).
This will be a bottleneck when running with many cpu cores.

@DanielHaimanot
DanielHaimanot merged commit ff0cf62 into main Sep 17, 2026
133 of 136 checks passed
@DanielHaimanot
DanielHaimanot deleted the icap_conn_pool branch September 17, 2026 03:03
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