Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ldesauw
Copy link
Contributor

@ldesauw ldesauw commented Dec 12, 2025

Description

Adds a connection-pool based network executor for KMIP clients with automatic fallback between endpoints and tests that validate fallback and recovery behavior.

Changes (high level)

Core: Implement ClientConnectionPool with dial-on-demand, per-endpoint cooldown, and fallback iteration.
Constructors: Add NewClientConnectionPoolContext and NewClientConnectionPool
Tests: Add unit tests exercising fallback and recovery.

- Rename `ClientNetworkConnection` -> `ClientConnectionPool` (add deprecated alias)
- Add constructors `NewClientConnectionPoolContext` and `NewClientConnectionPool`
- Keep backward-compatible wrappers (`NewClientNetworkConnection*`, `DialWithFallback` delegating)
- Improve fallback logic and connection handling in `kmipclient/network_executor.go`
- Add tests in `kmipclient/network_executor_test.go`:
  - TestClientNetworkConnection_Fallback
  - TestClientConnectionPool_PrimaryUpNoFallback
  - TestClientConnectionPool_AllDownError
  - TestClientConnectionPool_IntermittentRecovery
- Add `kmiptest` helpers (`NewServerWithHandle`, cert/listener helpers) to support tests
- Fix test cleanup and lint warnings

BREAKING CHANGE: exported type renamed from `ClientNetworkConnection` to `ClientConnectionPool`; a compatibility alias and wrappers are provided.
@ldesauw ldesauw requested a review from a team as a code owner December 12, 2025 14:42
@ldesauw ldesauw marked this pull request as draft December 15, 2025 12:43
@ldesauw ldesauw closed this Dec 22, 2025
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