132 Commits
Author SHA1 Message Date
zooqueen 55d12d9e97 generate the service half, and reach a sibling container at the host
Two failures, neither in this code.

  internal/test/my_service could not build: `undefined: MyServiceServer`. Its
    .psrpc.go half is gitignored on purpose (internal/test/.gitignore carries
    **/*.psrpc.go) — generated, not committed — so a fresh checkout has the
    .pb.go and none of the service code that goes with it, and nothing in the
    gate ever generated it. It does now, from the plugin in this repo. Only the
    psrpc half: the .pb.go beside it IS committed, and regenerating that too
    rewrites it against whatever protoc the runner carries.

    From the package directory, as gen.go does. paths=source_relative places
    output beside the .proto AS NAMED, so running it from the root writes
    my_service.psrpc.go into the root and every build then reports `found
    packages psrpc and my_service in <root>`.

  internal/bus dialled 127.0.0.1 for containers it had just started:

      bustest.go:51: dial tcp 127.0.0.1:32769: connect: connection refused

    CI runs the job inside a container with the host's /var/run/docker.sock
    bound in, so nats and redis come up as SIBLINGS — published on the HOST's
    loopback, while the job's own 127.0.0.1 is a different interface with
    nothing on it. dockertest reports the daemon's view; the port it chose is
    right and the host is not, so hostPort keeps the port and answers the host:
    the bridge gateway from inside a container, loopback outside one, and
    DOCKER_TEST_HOST ahead of both.

Verified against a real daemon: internal/bus goes from refused to ok in 18s,
and the gate's own command — generate, build, then the package list it already
uses — passes 19 packages, exit 0.
2026-08-11 00:12:35 -07:00
zeekayandHanzo Dev 633fe4a7a1 ci: canonical pair — hanzo.yml + forge caller
github.com has no runner for hanzo-build-linux-amd64, so a caller under
.github/workflows is a gate that can never be scheduled. This is the ~7-line
caller on the plane that can (git.hanzo.ai git-runner fleet), pinned @v1.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-06 02:27:19 -07:00
zeekayandHanzo Dev a58f1a5f91 refactor: kv vocabulary throughout, on hanzokv/go v9.22.0
hanzokv/go v9.22.0 renames its Go package from `redis` to `kv` (import
path unchanged). Follow that through the fork so there is one vocabulary
for the key-value bus:

- bus_redis.go -> bus_kv.go, bus_redis_test.go -> bus_kv_test.go,
  bustest/redis.go -> bustest/kv.go
- redisMessageBus -> kvMessageBus, and the same for its subscription,
  sublist, write-op, publish-queue and bustest server types
- psrpc.NewRedisMessageBus -> psrpc.NewKVMessageBus,
  bus.NewRedisMessageBus -> bus.NewKVMessageBus
- log messages and README say kv

The dockertest image stays `redis:latest` and the pipelining doc link
stays on redis.io: those name third-party artifacts, not our types.

Co-authored-by: Hanzo Dev <[email protected]>
v0.7.4
2026-07-26 08:38:46 -07:00
zeekay 24eca416c1 fork: retarget psrpc at github.com/hanzokv/go
PSRPC for Hanzo LiveKit, forked from livekit/psrpc (Apache-2.0). Two rewrites:

  github.com/livekit/psrpc      -> github.com/hanzoai/psrpc
  github.com/redis/go-redis/v9  -> github.com/hanzokv/go/v9

psrpc's message bus (bus.go, internal/bus/bus_redis.go, internal/bus/bustest)
speaks to a KV over go-redis. After hanzoai/livekit moved to our client, psrpc
was the one remaining edge pulling upstream go-redis into that binary — not our
code, but our dependency, the same shape redsync had for hanzoai/git.

The other livekit/* modules (protocol, mediatransportutil, mageutil) are NOT
forked and should not be: none of them touch a KV client, so they are ordinary
external dependencies and their names are addresses.
v0.7.3
2026-07-26 08:12:46 -07:00
He ChenandGitHub ed3af892dd TELCU-1: clamp expiry to caller's deadline (#117) 2026-07-23 15:29:46 -07:00
Paul WellsandGitHub 02da2844f3 deps: go get -u + migrate dockertest v3 -> v4 (#115)
* deps: bump dependencies (go get -u) and migrate dockertest v3 -> v4

Sweeps go get -u ./... and bumps dockertest to v4, the only direct dep
that needed an explicit major version bump. Migrates the 4 testutils
helpers in internal/bus/bustest/ to v4 (Pool/Resource are now interfaces;
NewPool/Run/Retry take ctx; RunWithOptions replaced by builder; Purge
replaced by ClosableResource.Close).

Other direct deps with newer majors available: none. +incompatible deps:
twitchtv/twirp v8.1.3 (upstream choice, no module-aware path published).

* client: use NewErrorFromResponse for the wire-derived error path

Passes res.Code/res.Error/res.ErrorDetails straight through instead of
round-tripping through NewErrorf, which also resolves the Go 1.25 vet
complaint about a non-constant format string. Plus the previous form
silently dropped error details.

* bump version
2026-06-05 14:13:20 -07:00
AlexandGitHub 51bf78dc7a Avoiding randomness when local context it done and waitTime is 0 (#113) 2026-03-26 20:42:49 -07:00
Paul WellsandGitHub 78ccb8d169 forward request options in otel middleware (#112) 2025-11-13 01:04:52 -08:00
Raja SubramanianandGitHub 0d6eb61a92 Use redis pipeline to deal with longer latency connections to Redis. (#111)
* Use redis pipeline to deal with longer latency connections to Redis.

- Using hashed publish queue (probably not super helpful as RelaySignal
  probably overwhelms others)
- Use `Pipeline`. Can potentially use `TxPipeline`, but that block other
  pipeline clients while it is executing. In tests though (trying to
  start 200 rooms with 200ms latency to redis server), the performance was
  comparable, i. e. all the rooms were created, but participant join
  needed some retries in some runs. In some other runs, participant join
  also worked without retries for that setting.
- Execute pipeline immediately (on a publish) and let the RTT processing
  opportunistically build up commands for the next pipeline execute.
  Maybe, it is possible to run each execute in a separate goroutine to
  handle cases of channels like RelaySignal running multiple in parallel,
  but ordering could cause subtle issues.

* clean up

* tidy

* add slack notifier

* comment pipeline usage
2025-11-05 22:28:26 +05:30
Paul WellsandGitHub de9e56f4c5 unblock client with pending recv when stream closes (#110) 2025-11-01 09:03:41 -07:00
AlexandGitHub 19ed400416 Adding two new error codes along with their conversion to http codes (#109) 2025-10-21 16:50:41 -07:00
Paul WellsandGitHub c8bd2dcb0b generate unimplemented psrpc server (#108) 2025-09-10 17:12:30 -07:00
Benjamin PrachtandGitHub b1be172cd6 Add UnprocessableEntity (#107) 2025-08-28 16:58:57 -07:00
Denys SmirnovandGitHub 294e6e039f Support OpenTelemetry traces for regular RPCs (#106)
* Support OpenTelemetry traces for regular RPCs.
2025-07-26 21:06:11 +03:00
Denys SmirnovandGitHub 0d3b81f3d1 Properly consider gRPC error statuses when retrying. (#105) 2025-07-24 19:18:01 +03:00
Paul WellsandGitHub f07e1b218a update mageutil for license (#104) 2025-05-10 22:31:45 -07:00
Denys SmirnovandGitHub aafbe4b4f4 Fix unwrapping of gRPC OK status. (#103) 2025-02-05 20:18:28 +02:00
Denys SmirnovandGitHub 5dca65aacb Fix gRPC error propagation. (#102) 2025-02-04 23:23:39 +02:00
Denys SmirnovandGitHub 2a293dac9e Allow passing custom error details, similar to gRPC. (#101) 2025-01-29 18:19:55 +02:00
Denys SmirnovandGitHub 4a7c5603ff Run Redis and NATS in Docker during tests. (#100) 2025-01-27 20:35:26 +02:00
Raja SubramanianandGitHub 8d4940d44b Delete SetChannelMode (#99) 2024-10-18 18:18:27 +05:30
David ColburnandGitHub 248dc5f10f 503 for timeout errors (#98) 2024-09-23 21:07:58 -04:00
Paul WellsandGitHub d405a12ed7 generate client close funcs (#97) 2024-09-20 23:37:02 -07:00
Paul WellsandGitHub ef56bb913a fix open stream metric (#96) 2024-06-15 18:24:58 -07:00
Paul WellsandGitHub 096670b9b8 add message bytes to metrics middleware (#95) 2024-05-26 12:29:18 -07:00
Paul WellsandGitHub cb3264b945 unblock subscriptions on close (#94) 2024-04-25 21:50:48 -07:00
Paul WellsandGitHub 59837372c0 allow multiple subs for the same nats topic (#93)
* allow multiple subs for the same nats topic

* test
2024-04-03 08:06:41 -07:00
Sean DuBoisandGitHub 8545d9c856 Add error logging to redisWriteOpQueue (#92)
Resolves livekit/livekit#2502
2024-03-26 23:59:54 -04:00
Paul WellsandGitHub c250cd90ce clean up legacy nats bus features (#91)
* clean up legacy nats bus features

* cleanup

* cleanup
2024-03-26 03:11:39 -07:00
Paul WellsandGitHub 5c404ca653 prevent encoding empty topic segments (#90)
* prevent encoding empty topic segments

* tidy
2024-03-14 21:57:30 -07:00
Paul WellsandGitHub 8ae8bd90c4 fix topic length check (#89) 2024-03-12 04:02:12 -07:00
Paul WellsandGitHub 28644f0103 fix topic segment formatting (#88)
* fix topic segment formatting

* cleanup
2024-03-11 23:47:08 -07:00
Paul WellsandGitHub c8e483a0c4 revert change to queue methods (#87)
* revert change to queue methods

* claim channel is never queue

* test
2024-03-10 18:08:27 -07:00
Paul WellsandGitHub 10b2b39cab add support for wildcard nats topics (#86)
* add support for wildcard nats topics

* disambiguate topicless server rpc channels and client channels

* cleanup

* cleanup

* channel format

* cleanup

* split queue subs

* cleanup

* move queue flag

* send local router channel in envelope

* test
2024-03-10 13:04:59 -07:00
Denys SmirnovandGitHub 31b290aa57 Honor context timeout in the client. (#84) 2024-02-28 19:24:57 +02:00
Denys SmirnovandGitHub 98c16b4550 Update usage of core.Fuse. (#83) 2024-02-27 17:43:51 +02:00
David ColburnandGitHub 0611542c99 custom server selection (#82) 2024-02-08 16:13:57 -08:00
David ColburnandGitHub 84d7ae1253 Add randomness to server selection (#81)
* add randomness to server selection

* change to request option
2024-01-29 14:39:32 -08:00
0d569528a3 fix redis pubsub receive message (#80)
* fix redis pubsub receive message

* add backoff to read retry delay

---------

Co-authored-by: Paul Wells <[email protected]>
2024-01-26 10:21:21 -08:00
Paul WellsandGitHub b7d85f83cc add test middleware to simulate link latency (#78)
* add test middleware to simulate link latency

* handle timer race

* cleanup
2023-12-13 21:50:26 -08:00
Benjamin PrachtandGitHub c7f287e45d Allow specifying custom retry behavior in retry middleware (#77)
Add an optional GetRetryParameters function member to RetryOptions. When defined, this will be called before each retry attempt and allow specifying whether to retry, the timeout, and a duration to wait before retrying.

Also add a simple unit test for the retry middleware.
2023-12-13 15:06:38 -08:00
Paul WellsandGitHub 5f0110939b timeout unanswered requests quickly (#76) 2023-11-18 06:27:18 -08:00
Paul WellsandGitHub 897561cda5 fix out of bounds slice access handling queue sub (#75) 2023-11-13 00:59:12 -08:00
Paul WellsandGitHub eaebff449f reuse one redis client for all subscriptions (#74)
* reuse one redis client for all subscriptions

* update deps

* update deps

* update deps

* update go

* test

* naming

* parallelize publish ops
2023-11-12 23:57:19 -08:00
David ColburnandGitHub 4762aefeb9 generate client and server ids (#73)
* generate client and server ids

* add option to supply ids
2023-10-25 18:22:56 -07:00
Paul WellsandGitHub 46e97f9b96 relax runtime compatibility check (#72)
* relax runtime compatibility check

* update deps
2023-10-23 19:29:15 -07:00
David ColburnandGitHub f9ce87b4f2 Affinity context (#71)
* add context to affinity

* update version
2023-10-23 16:29:31 -07:00
Paul WellsandGitHub dc1506aa6a allow adding interceptors via request options (#70) 2023-10-06 07:12:45 -07:00
Paul WellsandGitHub 3a108b74e9 add unreliable bus test utility (#69) 2023-10-05 02:08:40 -07:00
Paul WellsandGitHub 7f12450abc add test bus wrapper (#68) 2023-09-20 19:40:16 -07:00