Expose rate-limit state and the resume signal on the session and fleet; per-class backoff; jitter test (§5) #151

Closed
opened 2026-08-27 19:21:16 +02:00 by thecrealm · 1 comment
Owner

Review finding 2026-08-27 (C2). NetworkPolicyEngine.rateLimitState: StateFlow and resumeConnectivity() exist but the engine is built privately in connect() (KatrixSession.kt:126,742); nothing on KatrixSession/AppserviceFleet exposes them and resumeConnectivity() has zero production callers. BackoffConfig is global, not per endpoint class; no jitter test.

Acceptance (§5 "public reactive rate-limit state", "resume signal", "per class backoff"): surfaced on session + fleet (and in the golden metrics-exporter sample), per-class backoff config, tests for each.

Review finding 2026-08-27 (C2). `NetworkPolicyEngine.rateLimitState: StateFlow` and `resumeConnectivity()` exist but the engine is built privately in `connect()` (`KatrixSession.kt:126,742`); nothing on `KatrixSession`/`AppserviceFleet` exposes them and `resumeConnectivity()` has zero production callers. `BackoffConfig` is global, not per endpoint class; no jitter test. Acceptance (§5 "public reactive rate-limit state", "resume signal", "per class backoff"): surfaced on session + fleet (and in the golden metrics-exporter sample), per-class backoff config, tests for each.
Author
Owner

Hook landed with #134 / D81 (commit f624a99): KatrixSession.connect(policy: NetworkPolicyEngine = NetworkPolicyEngine(httpPort)) mirrors the fleet's seam, so a consumer-built engine (custom NetworkPolicyConfig) now reaches the session; NetworkPolicyEngine also implements the new RetryPolicy (retryDelay/awaitRetry) that the sync loop and send worker use. Exposing rateLimitState/resumeConnectivity() on session + fleet, per-class BackoffConfig, and the jitter test remain this issue's scope (a basic ±20 % jitter assertion exists in NetworkPolicyEngineTest.retryDelayPrefersServerDelayElseComputedBackoff).

Hook landed with #134 / D81 (commit f624a99): `KatrixSession.connect(policy: NetworkPolicyEngine = NetworkPolicyEngine(httpPort))` mirrors the fleet's seam, so a consumer-built engine (custom `NetworkPolicyConfig`) now reaches the session; `NetworkPolicyEngine` also implements the new `RetryPolicy` (`retryDelay`/`awaitRetry`) that the sync loop and send worker use. Exposing `rateLimitState`/`resumeConnectivity()` on session + fleet, per-class `BackoffConfig`, and the jitter test remain this issue's scope (a basic ±20 % jitter assertion exists in `NetworkPolicyEngineTest.retryDelayPrefersServerDelayElseComputedBackoff`).
thecrealm added
now
and removed
next
labels 2026-09-11 20:26:42 +02:00
thecrealm 2026-09-11 20:46:55 +02:00
  • closed this issue
  • removed the
    now
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thecrealm/katrix#151
No description provided.