Repository navigation
v2.6.7
v2.6.7
New Modules
- limiter: Introduce the
Maker/Limiterabstraction with rule normalization, result metadata, a global maker and configurable failure policies, so rate limiting can be shared across backends. (commit) - limiter/memory: Add a sharded in-process token bucket backend with expired-bucket eviction, bucket pooling and lifecycle management. (commit)
- limiter/redis: Add a standalone Redis backend that evaluates an atomic Lua token bucket against server time, refreshes key TTLs and supports a configurable timeout with fail-open or fail-closed behavior. (commit)
- core/limiter: Expose
Taketo report remaining tokens and the retry delay while preserving the existingAllowbehavior. (commit)
New Features
- cluster/gate: Add per-connection rate limiting via
cluster.gate.limiter(quota,period,burst,closeThreshold); connections are closed after exceeding the consecutive rejection threshold. (commit) - cluster/gate: Add a sharded per-IP admission guard via
cluster.gate.guardthat enforces concurrent connection limits, admission rates, whitelist bypass and temporary bans with escalating durations; bans close tracked connections, the entry table is bounded with fail-open behavior, and message limiter strikes feed the ban counters. (commit) - network/tcp, network/ws, network/kcp, network/quic: Support IPv6 dual-stack listeners:
:portand[::]:portaccept IPv4 and IPv6 clients, while0.0.0.0:portstays IPv4-only; kcp and quic create the UDP packet connection with the selected network and close it on shutdown. (commit) - utils/xnet: Add
IP2BytesandBytes2IPfor 16-byte IPv4-mapped and IPv6 addresses, keepingIP2LongandLong2IPon their existing uint32 IPv4 form. (commit) - internal/transporter: Negotiate the GetIP response format: a legacy request keeps the original 4-byte IPv4 payload, while an IPv6 address makes an updated client retry with an extended request for a 16-byte payload, so pre-upgrade peers never receive a payload their decoder rejects. (commit)
- config/nacos: Support Nacos 3.x admin authentication through the v3 login endpoint, with token caching, one refresh after an auth rejection, throttled forced re-logins and an actionable credentials-required error when anonymous access is denied and no account is configured. (commit)
- config/nacos: Export all configurations as a ZIP on the first full load and reuse cached content for unchanged items, invalidating a dataId cache entry when a change is pushed. (commit)
- config/nacos: List configurations through the Nacos v3 admin API so periodic searches receive metadata without the content of every configuration, falling back to the wrapped client when the endpoint is unavailable or not permitted, and reuse returned content during
Loadunless KMS decryption is enabled. (commit) - cluster/node: Accept an empty request payload as an empty message instead of rejecting it. (commit)
Fixes
- cluster/gate: Harden connection close semantics and gate event ordering, close gate clients during shutdown, serialize registry refresh and stale binding cleanup, and bound stale cleanup. (commit) (commit) (commit) (commit)
- cluster/gate: Retry and throttle limiter closes off the receive callback, count single-target batch pushes without disconnecting clients, and bound batch pushes. (commit) (commit) (commit)
- cluster/gate: Handle early gate handshakes and panicking hooks without losing clients. (commit)
- cluster/client: Guard client connect registration, keep frames received before the connect hook completes, and align connect hook ordering. (commit) (commit)
- cluster/node: Close node clients on destroy, dispatch empty requests, and wake
Node.Closefrom the last completed wait. (commit) (commit) - cluster/mesh: Release proxy resources when gate and node clients close. (commit)
- limiter: Reject conflicting scene rules when several makers are registered. (commit)
- internal/transporter: Initialize the drpc write wait group before starting the read goroutine, so an early read failure cannot reach a nil wait group while shutting the connection down. (commit)
Performance
- cluster/gate: Use integer GCRA and pooled buckets in the connection limiter and optimize its hot path. (commit) (commit)
- cluster/node: Index schedulable actors by event so dispatch visits only subscribers instead of scanning every actor of the node. (commit)
- utils/xnet, core/net: Remove address conversion allocations by parsing with
netipand unwrapping TCP and UDP addresses directly, while preserving the IPv6 zone suffix. (commit) - internal/transporter: Cut GetIP address parsing and decoding allocations. (commit)
- limiter/memory: Add cursor-based eviction of expired buckets, reduce allocations and use
WaitGroup.Gofor cleanup. (commit) (commit) (commit) - limiter/redis: Fail fast on circuit-breaker trips and optimize the Lua script path. (commit)
Breaking Changes
- core/location, utils/xlocation: Remove the unused IP geolocation manager, resolver interface, the ipwhois, ipapico and ipapicom resolvers and the location helper. No package in this repository referenced them; external callers importing these paths must provide their own resolver. (commit)
Dependencies
- Upgrade
github.com/nacos-group/nacos-sdk-go/v2from v2.3.5 to v2.3.6 and drop the now-unusedantsdependency. (commit) - Align the
github.com/dobyte/due/v2requirement to v2.6.7 in all 29 component modules. (commit)
Documentation
- Document the gate limiter and guard sample configuration, the handler lifecycle and disconnect ordering, the IPv4/IPv6 listen address semantics and the actor event subscription index. (commit) (commit) (commit)
Full Changelog: v2.6.6...v2.6.7