v1.10.2
Changes since v1.10.1.
-
Return
ErrMalformPktinstead of panicking on truncated initial handshake packets, including the greeting received before TLS negotiation. (GHSA-9qjq-77h9-895w, #1850) -
Discard connections after a failed
LOAD DATA LOCAL INFILE, including readerClose()errors, so unread results from a multi-statement batch cannot be returned to a later caller. Preserve the server's response status and avoid retrying the batch after an upload write failure. (GHSA-4v5x-9mc8-gr98) -
Reject
interpolateParams=truecombined with an unsafe multibyte charset (big5,sjis,gbk,cp932,gb18030) given bycharsetorCharset(). Previously onlycollationwas checked. Collations are now matched case-insensitively and by their charset prefix. The check also runs again after aBeforeConnectcallback has modified the config. Stop rejectinggb2312_bin; GB2312 trailing bytes cannot contain a backslash. The error text changed frominvalid DSN: interpolateParams can not be used with unsafe collationstointerpolateParams cannot be used with unsafe charsets, because it may also be returned byNewConnectororConnector.ConnectafterBeforeConnect. Applications comparing the complete error string must update their comparison. (#1836) -
Fix
interpolateParamsnot treating--followed by\v,\f, another control character, DEL, or a raw0xA0byte as a comment. Other non-ASCII bytes after--remain outside the supported interpolation grammar. (#1836) -
Fix
interpolateParamstreating the*that opens/*/as closing the comment. (#1835)
-
Honor
BeforeConnectchanges to the timeout, dialer, logger, and connection attributes without modifying the shared connector. (#1809) -
Validate prepared statement arguments and packet size before sending long data, and reset the statement if a long-data write fails. (#1810)
-
Fix the reported precision of unsigned DECIMAL columns. (#1813)
-
Preserve full two-byte column collation IDs so IDs above 255 do not cause text columns to be reported as binary columns. (#1818)
-
Fix the inverted check for collations outside the handshake's one-byte map. Accept them when a charset is supplied, using
SET NAMES ... COLLATE; reject them when no charset is supplied instead of silently using the default collation. (#1832) -
Preserve and log idle server error packets before discarding a connection, with bounded diagnostics over plain, TLS, and zlib connections. (#1843)
9.24.0-beta.1
This is a beta release. The release adds:
- The experimental MultiDB client for Active-Active (Redis Enterprise) failover.
- Metadata-driven cluster routing and client-side caching (CSC) eligibility that comes from the
COMMANDmetadata. - CSC OPT-IN / OPT-OUT tracking modes, CSC on
ClusterClient, and CSC withEphemeralConn. - A per-client
OTelRecorder, and MultiDB metrics inredisotel-native. - New full-duplex options (
FullDuplexPipes,PipelineMinIdleConns) and a cluster recovery fix for full-duplex sessions. - Commands for Redis 8.10 and for the 8.12 release candidates (
BACKUP, set member expiration,BITRANGEINTARRAY,ZMOVE,CF.COMPACT,BLESS, scalar-quantized HNSW).
NewMultiDBClient routes commands to one active database out of several standalone or cluster members (e.g. Redis Enterprise Active-Active) and fails over based on circuit breakers, health checks and a weight-based failover strategy, with auto-fallback to higher-weight members. The multidb package adds ping and lag-aware health checks and probe policies. See example/multidb (#3954) by @ndyakov. Defaults:
- MultiDB owns retries:
CommandRetries(0 = 2, -1 = none) retries on the database active at each attempt, and every attempt is counted by the breaker and failure detector. Standalone members get no retries of their own (MaxRetries0 becomes -1); an explicitMaxRetriesis kept. - Health checks: HEALTHY_ALL, 3 probes 500ms apart per check, honoring
multidb.WithProbes/WithDelay/WithTimeout;HealthCheckTimeout(3s) caps the pass. Probes that cannot fit it are rejected at construction and byAddDatabase. Under the default policy,SetActiveDatabaseandProbeTargetBeforeFailoveruse one probe per check. - Startup:
InitialDBStateMajorityAvailableneeds half the members, rounded up (1 of 2). A failed start matchesErrInsufficientHealthyDatabases; with no healthy member it also matchesErrPermanentlyNotAvailable. - Weights are in (0, 1] (0 = 1.0); -1 disables a member. The last enabled member cannot be disabled.
- The default failure detector (1000 failures and 10% within 2s) is set with
FailureDetectorConfig, whose fields are used as given; start fromDefaultMultiDBFailureDetectorConfig(). redisotel-nativereports MultiDB events (failover, active database change, circuit breaker state change, health check) in a newmultidbmetric group,MetricGroupFlagMultiDB, whichMetricGroupAllincludes (#4007) by @ndyakov.- A member
ProcessHookthat returnsnilwithout callingnextis no longer counted as a healthy database response (#4271) by @harshitdeora. A local result of a member hook in a cluster pipeline is kept when another node fails (#4279) by @harshitdeora. Full-duplex outcomes are recorded in the failure window after the active member is selected again (#4283) by @xixi-box.
Experimental: the MultiDB API can change in a minor release. User hooks and health checks must not call MultiDB control methods or Close.
Cluster routing and CSC use the same resolved COMMAND record for each command, so flags, key positions and policies cannot drift between two metadata sources (#3960, #4093) by @ofekshenawa.
- Cluster routing shares command metadata with client-side caching for key extraction and read-only status. Existing default routing and cluster-wide
DBSize,ScriptLoad,ScriptFlush, andScriptExistshelpers are preserved. InstallNewCommandMetadataResolver()orclient.NewDynamicResolver()withSetCommandInfoResolverto enable metadata-based fan-out and aggregation.CommandMetadataconfiguration alone does not enable them. Cross-slot fan-out is not atomic. - With metadata routing enabled, cross-slot
MGETfollows redirects for each affected slot during resharding instead of returning a missing value for a key that moved. Successful slot groups are not replayed. - Explicit pipelines and transactions retain node-local command execution; ordered
AsyncAutoPipelinerejects fan-out before dispatch. Same-slot metadata commands remain batchable. Automatic fan-out is available through the blocking face or unordered half-duplex mode. Existing direct helpers and special routing retain their separate execution path.SCAN,INFO, and known diagnostics remain node-local. Single-slot raw commands and binary marshaler values are accepted when no fan-out is needed. - Numeric sum/min/max fan-out preserves integer replies as exact
int64results, including rawDoresults; integer overflow returns an error. Aggregates containing floating-point replies returnfloat64. - Resolved command key specifications take precedence over
SetFirstKeyPos. Missing snapshot commands retain the legacy key-position fallback; configureCommandMetadataPreferLiveorCommandMetadataConfig.Overridesfor full metadata. The defaultCommandMetadataStaticmode performs no network lookup unless resolution reaches an explicitly installedNewDynamicResolver. After activation, reconnects, topology changes and a configured refresh interval also verify server identity in Static mode. - Embedded command wrappers retain raw-reply safety checks and receive typed aggregate results through their promoted
SetValmethods. - Metadata identity probes have bounded internal deadlines, including when application socket timeouts are disabled. Waiting callers can cancel independently of an ongoing refresh. Dynamic resolution waits for one initial attempt; after failure or invalidation, commands use conservative metadata immediately while background verification retries with backoff.
- Cluster routing decisions are stored on commands without using commands as map keys, and concurrent topology reloads share one in-flight load.
- Topology loading prefers
CLUSTER SHARDSand falls back toCLUSTER SLOTSfor unsupported commands or unusable replies, including missing or unknown node health. Connection failures try another node without repeatingSLOTSon the failed connection. - Keyless routing prefers healthy nodes, but temporary local failure/loading markers no longer exclude every candidate. Nodes explicitly marked offline by topology remain excluded.
ErrClusterTopologyUnhealthysupportserrors.Ischecks. Unknown response policies return an error. - Fan-out responses containing
MOVEDorASKrefresh topology for later commands without replaying already successful operations. FT.CURSOR READis no longer automatically retried after a lost reply, on standalone and cluster clients, because the server may already have advanced the cursor. Cursor ownership handling is not part of this release.- A
SCANiterator on aClusterClientnow visits every master. Before, it sent each page to a random node with the cursor of another node and could end early without an error (#4200) by @ndyakov. - With the dynamic resolver,
DEL,EXISTS,TOUCHandUNLINKon several keys of one slot returned the per-slot count multiplied by the number of keys in that slot. They now count each slot once (#4141) by @lazerg.
Experimental: the CSC options can change in a minor release.
- OPT-IN and OPT-OUT tracking modes:
Options.ClientSideCacheTrackingModeselectsTrackingModePlain(default),TrackingModeOptInorTrackingModeOptOut.Options.ClientSideCacheableis a predicate that selects the eligible unmarked calls, andWithCache(ctx)/WithoutCache(ctx)mark one call. The mode works with miss coalescing, refresh on invalidate, pipelines, autopipeline and cluster fan-out. With CSC on, the native full-duplex engine leases only the untracked pipeline pool and does not use the main pool (#4193) by @ofekshenawa. - CSC on
ClusterClient: each node client has its own cache, shared by its connection pool, with per-node capacity limits.ClusterOptions,UniversalOptionsandNewFailoverClusterClientaccept the CSC options, andCSCStats()andCSCRefreshStats()add up the registered nodes. The client does not store a reply that cannot prove that every key it depends on exists. A MOVED or ASK redirect bypasses the cache, and a topology change flushes only the caches of nodes that enter or leave routing. Replica reads, ordinary pipelines, transactions and full-duplex batches stay uncached (#4080) by @ofekshenawa. - Ephemeral connections with client-side caching: with CSC active,
EphemeralConnnow lazily dials a fresh, untracked connection. Session commands are allowed without disrupting the parent cache, and reads always go to Redis. The connection takes noPoolSizeturn, does not support maintenance handoff, and must be closed after use. Without CSC, idle-connection reuse is unchanged (#4174) by @aditya-rai-5.
AutoPipelineOptions.FullDuplexPipessets the number of full-duplex pipes (held connections) on a standaloneClient. 0 means 1.NumShards > 1underFullDuplexstill selects that number whenFullDuplexPipesis 0, butFullDuplexPipesis the preferred name.Config().FullDuplexPipesreports the effective count. On a cluster, a full-duplex autopipeliner keeps one pipe for each master (#4107) by @ndyakov.- Warm spare connection:
Options.PipelineMinIdleConns(default 0,pipeline_min_idle_connsin URLs) sets the minimum idle connections of the dedicated pipeline pool, and is available onClusterOptions,RingOptions,FailoverOptionsandUniversalOptions. A full-duplex engine keeps one idle spare, so a replacement for a failed held connection does not wait for a TCP or TLS dial. The spare is dialed but not initialized:HELLOandAUTHstill run on the first lease (#4101) by @ndyakov. - Cluster recovery: when the session of a node engine drops, the engine used to replay the unacknowledged commands only on a new connection to the same node, and failed them if that node was closed or replaced. The commands now go through the cluster router, so they reach the new owner of the slot (#4111) by @ndyakov.
- OTel metrics no longer cost throughput: with
redisotel-nativeon, full duplex lost about 90% of its throughput. In one test with 256 callers and 64 commands in flight on a local Redis,GETthroughput went from about 190k/s on v9.23.0 to about 2.1M/s now (about 10x; about 2.0M/s with OTel off). The gain depends on RTT, the number of commands in flight and the CPU, so expect a smaller effect on a remote Redis. The full-duplex reader reads its goroutine id once for each session, andRecordOperationDurationuses a bounded attribute cache and a queue for the success path (#4269) by @ndyakov.
Each client can have its own metrics recorder. Set OTelRecorder in Options, ClusterOptions, RingOptions, FailoverOptions, UniversalOptions or MultiDBOptions. The client sends its commands, pipelines, errors, cluster redirects, Pub/Sub messages, stream lag, and pool and connection events to it. Cluster nodes, ring shards, sentinel clients and MultiDB members use the recorder of their parent. Clients without it use the recorder from redis.SetOTelRecorder, as before. In redisotel-native, NewRecorder makes a recorder with its own WithCustomAttributes, which take precedence over the attributes of the global Init config (#4179) by @vladvildanov.
inst := redisotel.GetObservabilityInstance()
_ = inst.Init(redisotel.NewConfig().WithEnabled(true).WithMeterProvider(provider))
defer inst.Shutdown()
acmeRec, _ := inst.NewRecorder(redisotel.NewConfig().
WithCustomAttributes(attribute.String("tenant", "acme")))
acme := redis.NewClient(&redis.Options{Addr: "acme:6379", OTelRecorder: acmeRec})
The 8.12 commands target the 8.12 release candidates (the CI image is 8.12-rc3). The commands and options can change before 8.12 is released.
- Set member expiration:
SExpire,SPExpire,SExpireAt,SPExpireAt(each withWithArgs),STTL,SPTTL,SExpireTime,SPExpireTime,SPersist,SAddEXandSAddEXWithArgs(#4165) by @ndyakov. BITRANGEINTARRAY(#4242) by @ndyakov.ZMOVE,BZMOVEandZMOVEMEMBER(#4289) by @ndyakov.CF.COMPACTasCFCompact(#4243) by @ndyakov.CELL_SIZEforCMS.INITBYDIMandCMS.INITBYPROB(CMSInitByDimCellSize,CMSInitByProbCellSize) (#4023) by @vlady-kotsev.- Scalar-quantized HNSW indexes in
FT.CREATE, and the two newFT.INFOfields (#4077) by @vlady-kotsev. BLESS GET,BLESS SET,BLESS CLEARandBLESS SCANfor theNO-EVICTflag (#4041) by @vlady-kotsev.BlessScanis node-local: scan each master of a cluster or ring.BACKUP START,SEAL,ABORT,CLEANUPandSTATUSfor Redis 8.10 (#4286) by @Purv-Kabaria.- Alignment with 8.12-rc2:
RERANKforFT.HYBRID, theBITRANGEINTARRAYoptions, and new command metadata (#4277) by @ndyakov.
Check these when you upgrade from 9.23.0:
ContextDeadlineErrorfor socket timeouts that come from a context deadline (#4263) by @aditya-rai-5. WithContextTimeoutEnabled: true, a socket timeout caused by the deadline of the caller's context now matchescontext.DeadlineExceededwitherrors.Is, and still matchesnet.ErrorwithTimeout() == true. The complete original transport error stays in the chain. The error type is internal to the pool, so useerrors.Is. Such an error is no longer retried, because the context has already expired, and its message starts withcontext deadline exceeded:. Earlier socket timeouts and hard read deadlines are unchanged.WithTimeoutkeeps hooks: a client returned byWithTimeoutnow runs the hooks of its parent. Before, it dropped them, so hooks added withAddHookdid not run for commands, pipelines and transactions on that client (#4095) by @CaliLuke.- CSC eligibility comes from the
COMMANDmetadata and fails closed (#3960) by @ofekshenawa. An unknown, malformed, blocking, nondeterministic or script-based command runs as usual but is not cached.JSON.MGETandTS.INFOare no longer cached by default. With CSC enabled, more eligible commands can be cached in the defaultStaticmetadata mode (theBF.*,CF.*,TOPK.*,TDIGEST.*,V*andAR*families,CMS.QUERY,EXPIRETIME,PEXPIRETIME,HEXPIRETIME,HPEXPIRETIME,PFCOUNT,SDIFFCARD,SUNIONCARD,ZINTERCARDand others).Command()results now also contain subcommand entries namedparent|child, for exampleclient|id. When built-in CSC is on, a rawCLIENT CACHINGcommand is rejected, like the other commands that change connection state (#4193) by @ofekshenawa. - Connection-pool limits:
MaxActiveConnsnow counts all connections registered with the pool (pooled, excess, and dedicatedNewConnconnections) plus in-flight dial reservations. Previously, admission checked only the pooled count (poolSize). Clients with this limit configured can now receiveErrPoolExhaustedfromNewConn/EphemeralConnor during bursts that previously exceeded the limit (#4174) by @aditya-rai-5. - Dial concurrency and prewarming:
NewConnnow waits for the sharedMaxConcurrentDialslimit and honors context cancellation while waiting. Idle prewarming shares this limit without holding a pool turn while waiting for dial capacity. Refill checks resume after foreground dials and successful prewarm dials complete, and concurrent refill requests are preserved. These pool-limit and prewarming changes apply to all clients using the pool, not only CSC-enabled ephemeral sessions (#4174). - Struct scan on a bad field:
ScanonHGETALL/HMGETresults used to stop at the first field that failed to decode, and withHGETALLthe set of filled fields was random. It now sets every field it can decode and still returns an error. When one field fails, that field's error is returned as before. When several fail, their errors are joined witherrors.Join, in key order forHGETALLand argument order forHMGET, soerrors.Isanderrors.Asmatch each of them. The underlying decoder error stays in the chain, soerrors.Is(err, strconv.ErrSyntax)anderrors.Aswith*strconv.NumErrorwork. For the built-in types, a field that fails to decode keeps its previous value, and a nil pointer field stays nil. A custom decoder (ScanRedis,UnmarshalTextorUnmarshalBinary) runs on the existing field and can leave a failed field changed, so do not rely on unchanged values after an error from one. Code that reuses the struct after an error will see more fields set (#4136 by @lazerg, #2255 by @cpoole, #4294 by @Avv123). - URL configuration validation:
ParseURL,ParseClusterURL, andParseFailoverURLnow reject negativedialer_retry_timeout,read_buffer_size, andwrite_buffer_sizevalues. Cluster and failover URLs that previously accepted negative retry timeouts now return an error; replace those values with0for no delay, or omit the parameter for the default 100 ms delay. An explicitdialer_retry_timeout=0now disables the retry delay (#4144) by @Samuel-Sorial.ParseURLandParseFailoverURLnow also reject a negative database number (#4275) by @ump45nose, and a plain-second duration that overflowsint64nanoseconds (#4276) by @ump45nose. A disableddial_timeout(0or a negative value in the URL) now means no dial deadline. Before, every dial failed at once (#4168) by @PerryLink. - Empty password with a username (opt-in): a
Usernamewith an emptyPasswordsends noAUTH, the same as 9.23.0. To authenticate an ACL user created withnopass, setAuthEmptyPassword: true(orauth_empty_password=truein the URL); for sentinel connections useSentinelAuthEmptyPassword(sentinel_auth_empty_password=true). The rule also applies to credentials fromCredentialsProvider,CredentialsProviderContextandStreamingCredentialsProviderused when a connection is set up; re-authentication on a credentials refresh is unchanged. Redis Enterprise and Redis Cloud databases with unauthenticated access can reject an empty password, which is why this is opt-in. The client-side cache keeps a separate namespace for a username that sends noAUTH(#4161 by @saddamr3e, #4194 by @ndyakov). - Ring telemetry:
redisotel.InstrumentTracingandInstrumentMetricsnow instrument existing shards. Remove any per-shard instrumentation workaround when instrumenting the ring to avoid duplicate spans and metrics (#4227) by @nk-batman21. - Full-duplex clients keep one idle spare connection: a full-duplex engine raises
MinIdleConnsof its pipeline pool to 1, so the pool holds one extra idle connection for each client (for each node on a cluster). SetPipelineMinIdleConnsto a negative value to opt out (#4101) by @ndyakov. - Replies nested deeper than 1000 levels fail: the RESP reader returns an error for a reply with more than 1000 levels of nested aggregates or attributes, instead of exhausting the stack (#4296) by @xixi-box.
Script.Loadkeeps the client-computed SHA-1: aScriptmade withNewScriptno longer takes the digest from theSCRIPT LOADreply. A server that replies with another digest cannot redirect laterRun/RunROcalls.NewScriptServerSHAstill uses the server digest (#3943) by @saddamr3e.PubSub.Channelmisuse does not panic: callingChannelandChannelWithSubscriptionson onePubSubnow returns a closed channel and logs a warning.Ring.Subscribe,PSubscribeandSSubscribewith no channels, or a failed shard lookup, return aPubSubthat carries the error and do not panic (#3968) by @VedantMadane.- Return values:
XInfoStreamFullnow reports a-1consumer-group lag when Redis replies with a nil lag, likeXInfoGroups(#4217) by @LindseyZ1205.ClusterClient.ScriptFlushnow returnsOK(#4252) by @LindseyZ1205. - New interface methods:
Cmdableand its sub-interfaces gain methods for the new commands (andBlessCmdable). This is the usual way go-redis adds commands. A custom type that implements these interfaces (for example a mock) must add the methods.
FT.AGGREGATEsteps:FILTERandLIMITare now steps inFTAggregateOptions.Steps, so you can filter beforeGROUPBY, filter more than once, and placeLIMITbetween steps.AggregateBuildergetsLimit(). The old tail fieldsFilterandLimitOffset/Limitstill work, are sent after all steps, and are deprecated in favor of steps (#4076) by @ndyakov- Per-stream IDs for
XRead:XReadArgs.IDsgives one ID for each stream, in the order ofStreams, and takes precedence overID(#4203) by @aozmekik - Native iterators for
ScanIterator:ScanIterator.Vals(ctx)returns aniter.Seq[string]for use withrange(#3348) by @khasanovbi - More URL options:
ParseURL,ParseClusterURLandParseFailoverURLacceptdialer_retries,dialer_retry_timeout,context_timeout_enabled,read_buffer_size,write_buffer_size,disable_identityandidentity_suffixwhere the options struct has the field (#4063) by @SulimanAbdulrazzaq - Context-aware credential subscriptions: the optional
auth.ContextStreamingCredentialsProviderinterface lets the client callSubscribeWithContextwhen it sets up a connection, so the context bounds the wait for the first credentials. Providers without the method keepSubscribe(#4249) by @PragalvaXFREZ - Per-node TLS verification for cluster URLs:
ParseClusterURLacceptstls_verify_node_host=trueonrediss://URLs. The parameter clearsTLSConfig.ServerName, so each node is verified against the host it is dialed at and not against the host of the first URL. Use it when each node has a certificate for its own host. The default is unchanged: every node is verified against the host of the first URL, so clusters that use one certificate and announce their nodes by IP continue to work.rediss://cluster URLs now also setMinVersion: tls.VersionTLS12, asParseURLandParseFailoverURLdo (#4145) by @PragalvaXFREZ skip_verifyinParseClusterURL: the cluster parser accepts?skip_verify=trueonrediss://URLs, likeParseURLandParseFailoverURL(#4106) by @PragalvaXFREZTSCreateRuleOptions.AlignTimestamp: the field is now exported, so callers outside the package can set the bucket alignment forTSCreateRuleWithArgs(#4280) by @pcbeingused333
Connections, pool and transactions
- Connection handshake and
Options.Limiter: the handshake of a new connection (HELLO,AUTH,SELECT,CLIENT SETINFO,CLIENT MAINT_NOTIFICATIONS) no longer callsLimiter.Allowper command. The command that dials pays one admission and reports the handshake result once; that admission also covers the commands anOnConnectcallback sends on the connection. A PubSub connection, a reconnect after a maintenance handoff, and a fresh full-duplex session each pay one admission for their handshake. Before, a circuit breaker in the half-open state spent its probe budget on the handshake and never closed (#4232) by @othoathydrahost. A panic in anOnConnector credentials hook now settles the limiter admission, so a half-open breaker does not stay stuck (#4247) by @ump45nose - Silent reply mix-up after a maintenance handoff: with maintenance notifications on, a
MOVINGhandoff under concurrent traffic could give one connection two owners. Both wrote on the same socket and read each other's replies, so aGETcould return the"OK"of aSET, with no error.putConnno longer releases a connection that a hook handed to a handoff, the init of a handoff restores the owner's state, a delayedMOVINGclaims the idle connection before it queues the handoff, and a later handoff mark is not lost (#4110, #4239) by @ndyakov - Free re-run of retired idle connections: when the server closes idle TLS connections (for example with a
timeoutsetting), the pre-command drain retires them, and each one used to cost a retry ofMaxRetries. The command was never written, so the client now runs it again without spending retries or backoff. The pool size caps these re-runs (#4197) by @dunglas - Transactions:
TxPipelinedreturns an error and drops the connection whenEXECreplies with a different number of results than the number of queued commands. This happens when Redis rejectsWATCHorMULTIinsideMULTI(#4186) by @saddamr3e. A rejectedMULTIdrops the connection, so queued commands do not leak to another borrower (#4192) by @saddamr3e.Tx.Closerequires anOKreply toUNWATCH, and removes the connection when the client cannot confirm a clean state (a refusedUNWATCH, or anEXECfailure with an unknown outcome). Before, such a connection could return to the pool withWATCHorMULTIstill active (#4316) by @xixi-box - Pipeline setup errors: when connection setup fails with a Redis error reply (for example
WRONGPASSfromAUTH), each queued command now gets the error. Before,Pipeline.Execreturned the error but every command hadErr() == niland a zero value (#4312) by @xh123637 - Idle connection at
MaxActiveConns: when an idle scan skipped an unusable connection and acquired a usable one on its last allowed attempt, the connection was removed from the idle list and never returned, soGetcould fail withErrPoolExhausted(#4322) by @xixi-box - TLS dial and context: a TLS dial now honors the caller's context deadline and cancellation during the handshake, and not only
DialTimeout(#4143) by @Samuel-Sorial - Late PubSub connection: a
PubSubconnection that finished its setup afterClient.Closedrained the pool is now closed and returnsErrClosed, on standalone, Sentinel and cluster clients (#4157) by @aditya-rai-5 - Maintenance notifications: a subscribed
PubSubconnection that gets aMOVINGwith a null endpoint stays under the control of thePubSub. Before, a handoff worker moved it to a new socket withoutSUBSCRIBE, andChannel()stopped delivering messages (#4246) by @ump45nose
Authentication and credentials
-
Pub/Sub re-authentication with
StreamingCredentialsProvideron RESP3: credential rotations now re-authenticate established Pub/Sub connections in place. Before, long-lived subscriber connections kept the old credentials (#4195) by @AdamMagued. Re-authentication is serialized for each connection, so an older credential cannot be written last (#4317) by @Nacl-HCl, and it skips a connection that was replaced after the rotation (#4309) by @ump45nose. A close during subscription setup no longer re-entersinitConnand panics (#4262) by @PragalvaXFREZ -
Rejected re-authentication: the connection is now closed when the server rejects a re-auth with
WRONGPASSorNOPERM. Before, it kept serving commands with the replaced credentials (#4058) by @saddamr3e -
Pub/Sub connection leak: a closed Pub/Sub connection no longer stays in memory, with its buffers, when a
StreamingCredentialsProvideris set (#4119) by @meruiden -
Conn,EphemeralConnandWatchwithStreamingCredentialsProvider: the derived clients now carry the credentials manager, so a cold connection no longer panics (#4155) by @TastyHeadphones -
Failover client with
StreamingCredentialsProvider:NewFailoverClientnow creates the streaming credentials manager, so new connections no longer panic ininitConn(#4182) by @lazerg -
CSC cache and TLS client certificates: clients that authenticate with different TLS client certificates (
tls-auth-clients-user) no longer share cache entries, so a restricted user cannot read entries that a privileged user fetched (#4261) by @saddamr3e Cluster, Sentinel and Ring -
Redirects without a host: with
cluster-preferred-endpoint-type unknown-endpoint, a null host inCLUSTER SLOTSis accepted and takes the host of the node that was asked (#4131) by @spicysharkco, andMOVED/ASKreplies without a host reuse the host of the node that sent them (#4205) by @soujasK. After a maintenance handoff, the client uses the host of the serving connection (#4233) by @ump45nose -
MOVEDto the node's own address: the client drops the connection whenMOVEDpoints to the node that sent it, so the next attempt reconnects (#4229) by @SergeiSadov -
Batch retry after a redirect: when the first reply of a node batch is retryable (for example
TRYAGAIN) and a later command getsMOVEDorASK, the redirected command is no longer sent twice. A non-idempotent command such asINCRcould run two times (#4258) by @lazerg -
NewFailoverClusterClientandConnMaxLifetimeJitter: the jitter and the failing timeout are now kept (#4196) by @nk-batman21. TheonClosehook is registered forFailoverClusterClient(#4000) by @roganartu -
Sentinel: the failover dialer uses
DialTimeout, soSubscribeto an unreachable master does not hang until the kernel gives up (#4067) by @lazerg. Unused replica clients from empty or filtered discovery replies are closed (#4220) by @Grivn -
Cluster commands:
ClusterAddSlotsRangeandClusterDelSlotsRangereturn an error for an invalid range and do not panic (#4225) by @ump45nose.ClusterShardsrejects an odd-lengthslotsarray (#4282) by @saddamr3e
Protocol and reply parsing
- Error elements inside arrays:
IntSliceCmd(TS.MADD,CMS.INCRBY),UintSliceCmd,FloatSliceCmd,StringSliceCmdandBoolSliceCmdnow read the whole array when an element is a Redis error. Before, they stopped at that element, and in a pipeline the next command read the rest as its own reply (#4071 by @saddamr3e, #4137 by @lazerg). The reader also keeps typed errors (MOVED,ASK,LOADING) as array elements (#4274) by @ndyakov - Reply desync hardening:
ReadSlicechecks the type of the header (#4219) by @saddamr3e.Discardcounts a RESP3 attribute and the element it decorates as one element (#4318) by @waw666waw666.VoidProcessorconsumes push frames whose first element is not a string (#4046) by @saddamr3e. A buffered push drain stops at a frame boundary, so a slow handler no longer makes a healthy connection fail withi/o timeoutand drops the CSC entries fetched on it (#4224) by @ndyakov - RESP3 numbers in
Cmd:Cmd.Float64,Float32and their slice forms accept RESP3 doubles (#4088) by @LindseyZ1205.Text,Int64,StringSliceand related accessors accept RESP3 doubles and big numbers (#4138) by @lazerg - 32-bit platforms: scanning a value that does not fit in
uintreturns an error (#4081) by @MokiMeow, andCmd.Int()rejects an out-of-range integer reply (#4256) by @b84330808 CLIENT INFOvalues: the parser accepts=in values such as the client name andlib-name.ClientInfo()andACLLog()failed on them (#4096) by @LindseyZ1205
Commands and search
- RediSearch:
FT.SEARCHon RESP2 reads the per-document score, payload and sort key correctly withNoContent(#4099) by @jayhemnani9910.EXPLAINSCOREand an emptyRETURNparse correctly (#4140) by @lazerg.FTInforeads fractional doubles on RESP2 (#4207) by @ump45nose and theCASESENSITIVEflag of a TAG field (#4291) by @Dv2Corn.FTCreatesendsSORTABLE,UNFandNOINDEXafter the field options (#4199) by @RaphaelFakhri.FTSearchQueryappliesCountOnlyand keeps the offset (#4268) by @RaphaelFakhri.FTHybridWithArgsalways sends theCOMBINEargument count (#4298) by @lazerg.NewDropIndexBuilder(...).DeleteDocs()does not panic (#4105) by @PragalvaXFREZ niloptions no longer panic:FTExplainWithArgs,FTSynUpdateWithArgsandCFReserveWithArgs(#4248) by @hktitof,HGetEXWithArgsandHSetEXWithArgs(#4214) by @LindseyZ1205.JSONGetWithArgswithniloptions sends the paths (#4185) by @LindseyZ1205- Argument order and count:
IGNOREis sent beforeLABELSin the five time-series builders that support it (for exampleTSAddWithArgsandTSCreateWithArgs), becauseLABELStakes the rest of the arguments (#4160) by @yuefdev.ModuleLoadexsendsARGSonce (#4191) by @LindseyZ1205.HSetandHMSetflatten typedmap[string]Targuments such asmap[string]int(#4235) by @ump45nose - Sub-millisecond timeouts:
XRead,XReadGroup,XClaim,WaitandWaitAOFno longer send a positive timeout shorter than 1 ms as0(wait forever) (#4292) by @Dv2Corn - Geo queries:
GeoRadiusandGeoRadiusByMemberno longer change the caller's*GeoRadiusQuery, so the second call with the same query works (#4173) by @LindseyZ1205 - Scripts: a queued
SCRIPT LOAD(in a pipeline) no longer gives an empty digest toNewScriptServerSHA(#4226) by @ump45nose HOTKEYS: the CPU time fields use the names that the server sends (#4206) by @ump45nose- Struct scan: the value passed to a
TextUnmarshalerorBinaryUnmarshaleris a copy, so an unmarshaler that decodes in place cannot change the reply (#4078) by @saddamr3e
Observability
redisotel-native:server.portno longer contains the pool id (for example6379_1) (#4086) by @zhechen-cs. The connection count includes connections that existed beforeInit(#4089) by @ninadsutrave. Pending requests and state no longer drift acrossInitandShutdown(#4142) by @ninadsutrave. The pool usage metric does not underflow when pool statistics disagree (#4031) by @andystaples
- Short bulk strings in one write:
Writerwrites the header of a bulk string with one call, and writes the value and CRLF together when the value is 32 bytes or less. Benchmarks ofWriteArgsinto abufio.Writershowed 15% to 31% less time for each command on three CPUs, for example -24% to -26% forGET keyand -27% to -31% for an 8-pairMSET. The bytes on the wire do not change (#4281) by @g4lb - OTel metrics and full duplex: see the full-duplex highlight above (#4269)
- CI images: the test matrix uses Redis 8.10.3 and the 8.12 release candidate (
8.12-rc3) (#4231, #4241, #4264, #4288) by @ndyakov - 32-bit build: a
386CI job runsgo vetand the tests, and the root tests compile for 32-bit (#4139) by @lazerg - Dependencies: the OpenTelemetry SDK and
golang.org/x/netare upgraded in the OTel adapters and examples, to fixgovulncheckfindings (#4087) by @ofekshenawa - Regression tests: a cold-start full-duplex cluster test bounds the number of connections (#4223) by @ndyakov, and a test locks the
MSETEXmulti-shard split (#4314) by @Zoomish - Test structure and flaky specs: the autopipeline tests are consolidated from 28 files into 5 (#4091), and some tests move to the standard
testingpackage (#4085, #4187). Fixes for flaky or Redis Enterprise-incompatible specs: #4172, #4180, #4210, #4211, #4215, #4218, #4255, #4260, #4270, #4307
We'd like to thank all the contributors who worked on this release!
@AdamMagued, @aditya-rai-5, @andystaples, @aozmekik, @Avv123, @b84330808, @CaliLuke, @cpoole, @dunglas, @Dv2Corn, @g4lb, @Grivn, @harshitdeora, @hktitof, @jayhemnani9910, @jjj-n, @khasanovbi, @lazerg, @LindseyZ1205, @meruiden, @MokiMeow, @mtnaskari, @Nacl-HCl, @ndyakov, @ninadsutrave, @nk-batman21, @ofekshenawa, @othoathydrahost, @pcbeingused333, @PerryLink, @PragalvaXFREZ, @Purv-Kabaria, @RaphaelFakhri, @rleungx, @roganartu, @saddamr3e, @Samuel-Sorial, @SergeiSadov, @soujasK, @spicysharkco, @SulimanAbdulrazzaq, @TastyHeadphones, @ump45nose, @VedantMadane, @vladvildanov, @vlady-kotsev, @waw666waw666, @xh123637, @xixi-box, @yamaankhan20, @yuefdev, @zhechen-cs, @Zoomish
Full Changelog: https://github.com/redis/go-redis/compare/v9.23.0...v9.24.0-beta.1
9.24.0-beta.1
This is a beta release. The release adds:
- The experimental MultiDB client for Active-Active (Redis Enterprise) failover.
- Metadata-driven cluster routing and client-side caching (CSC) eligibility that comes from the
COMMANDmetadata. - CSC OPT-IN / OPT-OUT tracking modes, CSC on
ClusterClient, and CSC withEphemeralConn. - A per-client
OTelRecorder, and MultiDB metrics inredisotel-native. - New full-duplex options (
FullDuplexPipes,PipelineMinIdleConns) and a cluster recovery fix for full-duplex sessions. - Commands for Redis 8.10 and for the 8.12 release candidates (
BACKUP, set member expiration,BITRANGEINTARRAY,ZMOVE,CF.COMPACT,BLESS, scalar-quantized HNSW).
NewMultiDBClient routes commands to one active database out of several standalone or cluster members (e.g. Redis Enterprise Active-Active) and fails over based on circuit breakers, health checks and a weight-based failover strategy, with auto-fallback to higher-weight members. The multidb package adds ping and lag-aware health checks and probe policies. See example/multidb (#3954) by @ndyakov. Defaults:
- MultiDB owns retries:
CommandRetries(0 = 2, -1 = none) retries on the database active at each attempt, and every attempt is counted by the breaker and failure detector. Standalone members get no retries of their own (MaxRetries0 becomes -1); an explicitMaxRetriesis kept. - Health checks: HEALTHY_ALL, 3 probes 500ms apart per check, honoring
multidb.WithProbes/WithDelay/WithTimeout;HealthCheckTimeout(3s) caps the pass. Probes that cannot fit it are rejected at construction and byAddDatabase. Under the default policy,SetActiveDatabaseandProbeTargetBeforeFailoveruse one probe per check. - Startup:
InitialDBStateMajorityAvailableneeds half the members, rounded up (1 of 2). A failed start matchesErrInsufficientHealthyDatabases; with no healthy member it also matchesErrPermanentlyNotAvailable. - Weights are in (0, 1] (0 = 1.0); -1 disables a member. The last enabled member cannot be disabled.
- The default failure detector (1000 failures and 10% within 2s) is set with
FailureDetectorConfig, whose fields are used as given; start fromDefaultMultiDBFailureDetectorConfig(). redisotel-nativereports MultiDB events (failover, active database change, circuit breaker state change, health check) in a newmultidbmetric group,MetricGroupFlagMultiDB, whichMetricGroupAllincludes (#4007) by @ndyakov.- A member
ProcessHookthat returnsnilwithout callingnextis no longer counted as a healthy database response (#4271) by @harshitdeora. A local result of a member hook in a cluster pipeline is kept when another node fails (#4279) by @harshitdeora. Full-duplex outcomes are recorded in the failure window after the active member is selected again (#4283) by @xixi-box.
Experimental: the MultiDB API can change in a minor release. User hooks and health checks must not call MultiDB control methods or Close.
Cluster routing and CSC use the same resolved COMMAND record for each command, so flags, key positions and policies cannot drift between two metadata sources (#3960, #4093) by @ofekshenawa.
- Cluster routing shares command metadata with client-side caching for key extraction and read-only status. Existing default routing and cluster-wide
DBSize,ScriptLoad,ScriptFlush, andScriptExistshelpers are preserved. InstallNewCommandMetadataResolver()orclient.NewDynamicResolver()withSetCommandInfoResolverto enable metadata-based fan-out and aggregation.CommandMetadataconfiguration alone does not enable them. Cross-slot fan-out is not atomic. - With metadata routing enabled, cross-slot
MGETfollows redirects for each affected slot during resharding instead of returning a missing value for a key that moved. Successful slot groups are not replayed. - Explicit pipelines and transactions retain node-local command execution; ordered
AsyncAutoPipelinerejects fan-out before dispatch. Same-slot metadata commands remain batchable. Automatic fan-out is available through the blocking face or unordered half-duplex mode. Existing direct helpers and special routing retain their separate execution path.SCAN,INFO, and known diagnostics remain node-local. Single-slot raw commands and binary marshaler values are accepted when no fan-out is needed. - Numeric sum/min/max fan-out preserves integer replies as exact
int64results, including rawDoresults; integer overflow returns an error. Aggregates containing floating-point replies returnfloat64. - Resolved command key specifications take precedence over
SetFirstKeyPos. Missing snapshot commands retain the legacy key-position fallback; configureCommandMetadataPreferLiveorCommandMetadataConfig.Overridesfor full metadata. The defaultCommandMetadataStaticmode performs no network lookup unless resolution reaches an explicitly installedNewDynamicResolver. After activation, reconnects, topology changes and a configured refresh interval also verify server identity in Static mode. - Embedded command wrappers retain raw-reply safety checks and receive typed aggregate results through their promoted
SetValmethods. - Metadata identity probes have bounded internal deadlines, including when application socket timeouts are disabled. Waiting callers can cancel independently of an ongoing refresh. Dynamic resolution waits for one initial attempt; after failure or invalidation, commands use conservative metadata immediately while background verification retries with backoff.
- Cluster routing decisions are stored on commands without using commands as map keys, and concurrent topology reloads share one in-flight load.
- Topology loading prefers
CLUSTER SHARDSand falls back toCLUSTER SLOTSfor unsupported commands or unusable replies, including missing or unknown node health. Connection failures try another node without repeatingSLOTSon the failed connection. - Keyless routing prefers healthy nodes, but temporary local failure/loading markers no longer exclude every candidate. Nodes explicitly marked offline by topology remain excluded.
ErrClusterTopologyUnhealthysupportserrors.Ischecks. Unknown response policies return an error. - Fan-out responses containing
MOVEDorASKrefresh topology for later commands without replaying already successful operations. FT.CURSOR READis no longer automatically retried after a lost reply, on standalone and cluster clients, because the server may already have advanced the cursor. Cursor ownership handling is not part of this release.- A
SCANiterator on aClusterClientnow visits every master. Before, it sent each page to a random node with the cursor of another node and could end early without an error (#4200) by @ndyakov. - With the dynamic resolver,
DEL,EXISTS,TOUCHandUNLINKon several keys of one slot returned the per-slot count multiplied by the number of keys in that slot. They now count each slot once (#4141) by @lazerg.
Experimental: the CSC options can change in a minor release.
- OPT-IN and OPT-OUT tracking modes:
Options.ClientSideCacheTrackingModeselectsTrackingModePlain(default),TrackingModeOptInorTrackingModeOptOut.Options.ClientSideCacheableis a predicate that selects the eligible unmarked calls, andWithCache(ctx)/WithoutCache(ctx)mark one call. The mode works with miss coalescing, refresh on invalidate, pipelines, autopipeline and cluster fan-out. With CSC on, the native full-duplex engine leases only the untracked pipeline pool and does not use the main pool (#4193) by @ofekshenawa. - CSC on
ClusterClient: each node client has its own cache, shared by its connection pool, with per-node capacity limits.ClusterOptions,UniversalOptionsandNewFailoverClusterClientaccept the CSC options, andCSCStats()andCSCRefreshStats()add up the registered nodes. The client does not store a reply that cannot prove that every key it depends on exists. A MOVED or ASK redirect bypasses the cache, and a topology change flushes only the caches of nodes that enter or leave routing. Replica reads, ordinary pipelines, transactions and full-duplex batches stay uncached (#4080) by @ofekshenawa. - Ephemeral connections with client-side caching: with CSC active,
EphemeralConnnow lazily dials a fresh, untracked connection. Session commands are allowed without disrupting the parent cache, and reads always go to Redis. The connection takes noPoolSizeturn, does not support maintenance handoff, and must be closed after use. Without CSC, idle-connection reuse is unchanged (#4174) by @aditya-rai-5.
AutoPipelineOptions.FullDuplexPipessets the number of full-duplex pipes (held connections) on a standaloneClient. 0 means 1.NumShards > 1underFullDuplexstill selects that number whenFullDuplexPipesis 0, butFullDuplexPipesis the preferred name.Config().FullDuplexPipesreports the effective count. On a cluster, a full-duplex autopipeliner keeps one pipe for each master (#4107) by @ndyakov.- Warm spare connection:
Options.PipelineMinIdleConns(default 0,pipeline_min_idle_connsin URLs) sets the minimum idle connections of the dedicated pipeline pool, and is available onClusterOptions,RingOptions,FailoverOptionsandUniversalOptions. A full-duplex engine keeps one idle spare, so a replacement for a failed held connection does not wait for a TCP or TLS dial. The spare is dialed but not initialized:HELLOandAUTHstill run on the first lease (#4101) by @ndyakov. - Cluster recovery: when the session of a node engine drops, the engine used to replay the unacknowledged commands only on a new connection to the same node, and failed them if that node was closed or replaced. The commands now go through the cluster router, so they reach the new owner of the slot (#4111) by @ndyakov.
- OTel metrics no longer cost throughput: with
redisotel-nativeon, full duplex lost about 90% of its throughput. In one test with 256 callers and 64 commands in flight on a local Redis,GETthroughput went from about 190k/s on v9.23.0 to about 2.1M/s now (about 10x; about 2.0M/s with OTel off). The gain depends on RTT, the number of commands in flight and the CPU, so expect a smaller effect on a remote Redis. The full-duplex reader reads its goroutine id once for each session, andRecordOperationDurationuses a bounded attribute cache and a queue for the success path (#4269) by @ndyakov.
Each client can have its own metrics recorder. Set OTelRecorder in Options, ClusterOptions, RingOptions, FailoverOptions, UniversalOptions or MultiDBOptions. The client sends its commands, pipelines, errors, cluster redirects, Pub/Sub messages, stream lag, and pool and connection events to it. Cluster nodes, ring shards, sentinel clients and MultiDB members use the recorder of their parent. Clients without it use the recorder from redis.SetOTelRecorder, as before. In redisotel-native, NewRecorder makes a recorder with its own WithCustomAttributes, which take precedence over the attributes of the global Init config (#4179) by @vladvildanov.
inst := redisotel.GetObservabilityInstance()
_ = inst.Init(redisotel.NewConfig().WithEnabled(true).WithMeterProvider(provider))
defer inst.Shutdown()
acmeRec, _ := inst.NewRecorder(redisotel.NewConfig().
WithCustomAttributes(attribute.String("tenant", "acme")))
acme := redis.NewClient(&redis.Options{Addr: "acme:6379", OTelRecorder: acmeRec})
The 8.12 commands target the 8.12 release candidates (the CI image is 8.12-rc3). The commands and options can change before 8.12 is released.
- Set member expiration:
SExpire,SPExpire,SExpireAt,SPExpireAt(each withWithArgs),STTL,SPTTL,SExpireTime,SPExpireTime,SPersist,SAddEXandSAddEXWithArgs(#4165) by @ndyakov. BITRANGEINTARRAY(#4242) by @ndyakov.ZMOVE,BZMOVEandZMOVEMEMBER(#4289) by @ndyakov.CF.COMPACTasCFCompact(#4243) by @ndyakov.CELL_SIZEforCMS.INITBYDIMandCMS.INITBYPROB(CMSInitByDimCellSize,CMSInitByProbCellSize) (#4023) by @vlady-kotsev.- Scalar-quantized HNSW indexes in
FT.CREATE, and the two newFT.INFOfields (#4077) by @vlady-kotsev. BLESS GET,BLESS SET,BLESS CLEARandBLESS SCANfor theNO-EVICTflag (#4041) by @vlady-kotsev.BlessScanis node-local: scan each master of a cluster or ring.BACKUP START,SEAL,ABORT,CLEANUPandSTATUSfor Redis 8.10 (#4286) by @Purv-Kabaria.- Alignment with 8.12-rc2:
RERANKforFT.HYBRID, theBITRANGEINTARRAYoptions, and new command metadata (#4277) by @ndyakov.
Check these when you upgrade from 9.23.0:
ContextDeadlineErrorfor socket timeouts that come from a context deadline (#4263) by @aditya-rai-5. WithContextTimeoutEnabled: true, a socket timeout caused by the deadline of the caller's context now matchescontext.DeadlineExceededwitherrors.Is, and still matchesnet.ErrorwithTimeout() == true. The complete original transport error stays in the chain. The error type is internal to the pool, so useerrors.Is. Such an error is no longer retried, because the context has already expired, and its message starts withcontext deadline exceeded:. Earlier socket timeouts and hard read deadlines are unchanged.WithTimeoutkeeps hooks: a client returned byWithTimeoutnow runs the hooks of its parent. Before, it dropped them, so hooks added withAddHookdid not run for commands, pipelines and transactions on that client (#4095) by @CaliLuke.- CSC eligibility comes from the
COMMANDmetadata and fails closed (#3960) by @ofekshenawa. An unknown, malformed, blocking, nondeterministic or script-based command runs as usual but is not cached.JSON.MGETandTS.INFOare no longer cached by default. With CSC enabled, more eligible commands can be cached in the defaultStaticmetadata mode (theBF.*,CF.*,TOPK.*,TDIGEST.*,V*andAR*families,CMS.QUERY,EXPIRETIME,PEXPIRETIME,HEXPIRETIME,HPEXPIRETIME,PFCOUNT,SDIFFCARD,SUNIONCARD,ZINTERCARDand others).Command()results now also contain subcommand entries namedparent|child, for exampleclient|id. When built-in CSC is on, a rawCLIENT CACHINGcommand is rejected, like the other commands that change connection state (#4193) by @ofekshenawa. - Connection-pool limits:
MaxActiveConnsnow counts all connections registered with the pool (pooled, excess, and dedicatedNewConnconnections) plus in-flight dial reservations. Previously, admission checked only the pooled count (poolSize). Clients with this limit configured can now receiveErrPoolExhaustedfromNewConn/EphemeralConnor during bursts that previously exceeded the limit (#4174) by @aditya-rai-5. - Dial concurrency and prewarming:
NewConnnow waits for the sharedMaxConcurrentDialslimit and honors context cancellation while waiting. Idle prewarming shares this limit without holding a pool turn while waiting for dial capacity. Refill checks resume after foreground dials and successful prewarm dials complete, and concurrent refill requests are preserved. These pool-limit and prewarming changes apply to all clients using the pool, not only CSC-enabled ephemeral sessions (#4174). - Struct scan on a bad field:
ScanonHGETALL/HMGETresults used to stop at the first field that failed to decode, and withHGETALLthe set of filled fields was random. It now sets every field it can decode and still returns an error. When one field fails, that field's error is returned as before. When several fail, their errors are joined witherrors.Join, in key order forHGETALLand argument order forHMGET, soerrors.Isanderrors.Asmatch each of them. The underlying decoder error stays in the chain, soerrors.Is(err, strconv.ErrSyntax)anderrors.Aswith*strconv.NumErrorwork. For the built-in types, a field that fails to decode keeps its previous value, and a nil pointer field stays nil. A custom decoder (ScanRedis,UnmarshalTextorUnmarshalBinary) runs on the existing field and can leave a failed field changed, so do not rely on unchanged values after an error from one. Code that reuses the struct after an error will see more fields set (#4136 by @lazerg, #2255 by @cpoole, #4294 by @Avv123). - URL configuration validation:
ParseURL,ParseClusterURL, andParseFailoverURLnow reject negativedialer_retry_timeout,read_buffer_size, andwrite_buffer_sizevalues. Cluster and failover URLs that previously accepted negative retry timeouts now return an error; replace those values with0for no delay, or omit the parameter for the default 100 ms delay. An explicitdialer_retry_timeout=0now disables the retry delay (#4144) by @Samuel-Sorial.ParseURLandParseFailoverURLnow also reject a negative database number (#4275) by @ump45nose, and a plain-second duration that overflowsint64nanoseconds (#4276) by @ump45nose. A disableddial_timeout(0or a negative value in the URL) now means no dial deadline. Before, every dial failed at once (#4168) by @PerryLink. - Empty password with a username (opt-in): a
Usernamewith an emptyPasswordsends noAUTH, the same as 9.23.0. To authenticate an ACL user created withnopass, setAuthEmptyPassword: true(orauth_empty_password=truein the URL); for sentinel connections useSentinelAuthEmptyPassword(sentinel_auth_empty_password=true). The rule also applies to credentials fromCredentialsProvider,CredentialsProviderContextandStreamingCredentialsProviderused when a connection is set up; re-authentication on a credentials refresh is unchanged. Redis Enterprise and Redis Cloud databases with unauthenticated access can reject an empty password, which is why this is opt-in. The client-side cache keeps a separate namespace for a username that sends noAUTH(#4161 by @saddamr3e, #4194 by @ndyakov). - Ring telemetry:
redisotel.InstrumentTracingandInstrumentMetricsnow instrument existing shards. Remove any per-shard instrumentation workaround when instrumenting the ring to avoid duplicate spans and metrics (#4227) by @nk-batman21. - Full-duplex clients keep one idle spare connection: a full-duplex engine raises
MinIdleConnsof its pipeline pool to 1, so the pool holds one extra idle connection for each client (for each node on a cluster). SetPipelineMinIdleConnsto a negative value to opt out (#4101) by @ndyakov. - Replies nested deeper than 1000 levels fail: the RESP reader returns an error for a reply with more than 1000 levels of nested aggregates or attributes, instead of exhausting the stack (#4296) by @xixi-box.
Script.Loadkeeps the client-computed SHA-1: aScriptmade withNewScriptno longer takes the digest from theSCRIPT LOADreply. A server that replies with another digest cannot redirect laterRun/RunROcalls.NewScriptServerSHAstill uses the server digest (#3943) by @saddamr3e.PubSub.Channelmisuse does not panic: callingChannelandChannelWithSubscriptionson onePubSubnow returns a closed channel and logs a warning.Ring.Subscribe,PSubscribeandSSubscribewith no channels, or a failed shard lookup, return aPubSubthat carries the error and do not panic (#3968) by @VedantMadane.- Return values:
XInfoStreamFullnow reports a-1consumer-group lag when Redis replies with a nil lag, likeXInfoGroups(#4217) by @LindseyZ1205.ClusterClient.ScriptFlushnow returnsOK(#4252) by @LindseyZ1205. - New interface methods:
Cmdableand its sub-interfaces gain methods for the new commands (andBlessCmdable). This is the usual way go-redis adds commands. A custom type that implements these interfaces (for example a mock) must add the methods.
FT.AGGREGATEsteps:FILTERandLIMITare now steps inFTAggregateOptions.Steps, so you can filter beforeGROUPBY, filter more than once, and placeLIMITbetween steps.AggregateBuildergetsLimit(). The old tail fieldsFilterandLimitOffset/Limitstill work, are sent after all steps, and are deprecated in favor of steps (#4076) by @ndyakov- Per-stream IDs for
XRead:XReadArgs.IDsgives one ID for each stream, in the order ofStreams, and takes precedence overID(#4203) by @aozmekik - Native iterators for
ScanIterator:ScanIterator.Vals(ctx)returns aniter.Seq[string]for use withrange(#3348) by @khasanovbi - More URL options:
ParseURL,ParseClusterURLandParseFailoverURLacceptdialer_retries,dialer_retry_timeout,context_timeout_enabled,read_buffer_size,write_buffer_size,disable_identityandidentity_suffixwhere the options struct has the field (#4063) by @SulimanAbdulrazzaq - Context-aware credential subscriptions: the optional
auth.ContextStreamingCredentialsProviderinterface lets the client callSubscribeWithContextwhen it sets up a connection, so the context bounds the wait for the first credentials. Providers without the method keepSubscribe(#4249) by @PragalvaXFREZ - Per-node TLS verification for cluster URLs:
ParseClusterURLacceptstls_verify_node_host=trueonrediss://URLs. The parameter clearsTLSConfig.ServerName, so each node is verified against the host it is dialed at and not against the host of the first URL. Use it when each node has a certificate for its own host. The default is unchanged: every node is verified against the host of the first URL, so clusters that use one certificate and announce their nodes by IP continue to work.rediss://cluster URLs now also setMinVersion: tls.VersionTLS12, asParseURLandParseFailoverURLdo (#4145) by @PragalvaXFREZ skip_verifyinParseClusterURL: the cluster parser accepts?skip_verify=trueonrediss://URLs, likeParseURLandParseFailoverURL(#4106) by @PragalvaXFREZTSCreateRuleOptions.AlignTimestamp: the field is now exported, so callers outside the package can set the bucket alignment forTSCreateRuleWithArgs(#4280) by @pcbeingused333
Connections, pool and transactions
- Connection handshake and
Options.Limiter: the handshake of a new connection (HELLO,AUTH,SELECT,CLIENT SETINFO,CLIENT MAINT_NOTIFICATIONS) no longer callsLimiter.Allowper command. The command that dials pays one admission and reports the handshake result once; that admission also covers the commands anOnConnectcallback sends on the connection. A PubSub connection, a reconnect after a maintenance handoff, and a fresh full-duplex session each pay one admission for their handshake. Before, a circuit breaker in the half-open state spent its probe budget on the handshake and never closed (#4232) by @othoathydrahost. A panic in anOnConnector credentials hook now settles the limiter admission, so a half-open breaker does not stay stuck (#4247) by @ump45nose - Silent reply mix-up after a maintenance handoff: with maintenance notifications on, a
MOVINGhandoff under concurrent traffic could give one connection two owners. Both wrote on the same socket and read each other's replies, so aGETcould return the"OK"of aSET, with no error.putConnno longer releases a connection that a hook handed to a handoff, the init of a handoff restores the owner's state, a delayedMOVINGclaims the idle connection before it queues the handoff, and a later handoff mark is not lost (#4110, #4239) by @ndyakov - Free re-run of retired idle connections: when the server closes idle TLS connections (for example with a
timeoutsetting), the pre-command drain retires them, and each one used to cost a retry ofMaxRetries. The command was never written, so the client now runs it again without spending retries or backoff. The pool size caps these re-runs (#4197) by @dunglas - Transactions:
TxPipelinedreturns an error and drops the connection whenEXECreplies with a different number of results than the number of queued commands. This happens when Redis rejectsWATCHorMULTIinsideMULTI(#4186) by @saddamr3e. A rejectedMULTIdrops the connection, so queued commands do not leak to another borrower (#4192) by @saddamr3e.Tx.Closerequires anOKreply toUNWATCH, and removes the connection when the client cannot confirm a clean state (a refusedUNWATCH, or anEXECfailure with an unknown outcome). Before, such a connection could return to the pool withWATCHorMULTIstill active (#4316) by @xixi-box - Pipeline setup errors: when connection setup fails with a Redis error reply (for example
WRONGPASSfromAUTH), each queued command now gets the error. Before,Pipeline.Execreturned the error but every command hadErr() == niland a zero value (#4312) by @xh123637 - Idle connection at
MaxActiveConns: when an idle scan skipped an unusable connection and acquired a usable one on its last allowed attempt, the connection was removed from the idle list and never returned, soGetcould fail withErrPoolExhausted(#4322) by @xixi-box - TLS dial and context: a TLS dial now honors the caller's context deadline and cancellation during the handshake, and not only
DialTimeout(#4143) by @Samuel-Sorial - Late PubSub connection: a
PubSubconnection that finished its setup afterClient.Closedrained the pool is now closed and returnsErrClosed, on standalone, Sentinel and cluster clients (#4157) by @aditya-rai-5 - Maintenance notifications: a subscribed
PubSubconnection that gets aMOVINGwith a null endpoint stays under the control of thePubSub. Before, a handoff worker moved it to a new socket withoutSUBSCRIBE, andChannel()stopped delivering messages (#4246) by @ump45nose
Authentication and credentials
-
Pub/Sub re-authentication with
StreamingCredentialsProvideron RESP3: credential rotations now re-authenticate established Pub/Sub connections in place. Before, long-lived subscriber connections kept the old credentials (#4195) by @AdamMagued. Re-authentication is serialized for each connection, so an older credential cannot be written last (#4317) by @Nacl-HCl, and it skips a connection that was replaced after the rotation (#4309) by @ump45nose. A close during subscription setup no longer re-entersinitConnand panics (#4262) by @PragalvaXFREZ -
Rejected re-authentication: the connection is now closed when the server rejects a re-auth with
WRONGPASSorNOPERM. Before, it kept serving commands with the replaced credentials (#4058) by @saddamr3e -
Pub/Sub connection leak: a closed Pub/Sub connection no longer stays in memory, with its buffers, when a
StreamingCredentialsProvideris set (#4119) by @meruiden -
Conn,EphemeralConnandWatchwithStreamingCredentialsProvider: the derived clients now carry the credentials manager, so a cold connection no longer panics (#4155) by @TastyHeadphones -
Failover client with
StreamingCredentialsProvider:NewFailoverClientnow creates the streaming credentials manager, so new connections no longer panic ininitConn(#4182) by @lazerg -
CSC cache and TLS client certificates: clients that authenticate with different TLS client certificates (
tls-auth-clients-user) no longer share cache entries, so a restricted user cannot read entries that a privileged user fetched (#4261) by @saddamr3e Cluster, Sentinel and Ring -
Redirects without a host: with
cluster-preferred-endpoint-type unknown-endpoint, a null host inCLUSTER SLOTSis accepted and takes the host of the node that was asked (#4131) by @spicysharkco, andMOVED/ASKreplies without a host reuse the host of the node that sent them (#4205) by @soujasK. After a maintenance handoff, the client uses the host of the serving connection (#4233) by @ump45nose -
MOVEDto the node's own address: the client drops the connection whenMOVEDpoints to the node that sent it, so the next attempt reconnects (#4229) by @SergeiSadov -
Batch retry after a redirect: when the first reply of a node batch is retryable (for example
TRYAGAIN) and a later command getsMOVEDorASK, the redirected command is no longer sent twice. A non-idempotent command such asINCRcould run two times (#4258) by @lazerg -
NewFailoverClusterClientandConnMaxLifetimeJitter: the jitter and the failing timeout are now kept (#4196) by @nk-batman21. TheonClosehook is registered forFailoverClusterClient(#4000) by @roganartu -
Sentinel: the failover dialer uses
DialTimeout, soSubscribeto an unreachable master does not hang until the kernel gives up (#4067) by @lazerg. Unused replica clients from empty or filtered discovery replies are closed (#4220) by @Grivn -
Cluster commands:
ClusterAddSlotsRangeandClusterDelSlotsRangereturn an error for an invalid range and do not panic (#4225) by @ump45nose.ClusterShardsrejects an odd-lengthslotsarray (#4282) by @saddamr3e
Protocol and reply parsing
- Error elements inside arrays:
IntSliceCmd(TS.MADD,CMS.INCRBY),UintSliceCmd,FloatSliceCmd,StringSliceCmdandBoolSliceCmdnow read the whole array when an element is a Redis error. Before, they stopped at that element, and in a pipeline the next command read the rest as its own reply (#4071 by @saddamr3e, #4137 by @lazerg). The reader also keeps typed errors (MOVED,ASK,LOADING) as array elements (#4274) by @ndyakov - Reply desync hardening:
ReadSlicechecks the type of the header (#4219) by @saddamr3e.Discardcounts a RESP3 attribute and the element it decorates as one element (#4318) by @waw666waw666.VoidProcessorconsumes push frames whose first element is not a string (#4046) by @saddamr3e. A buffered push drain stops at a frame boundary, so a slow handler no longer makes a healthy connection fail withi/o timeoutand drops the CSC entries fetched on it (#4224) by @ndyakov - RESP3 numbers in
Cmd:Cmd.Float64,Float32and their slice forms accept RESP3 doubles (#4088) by @LindseyZ1205.Text,Int64,StringSliceand related accessors accept RESP3 doubles and big numbers (#4138) by @lazerg - 32-bit platforms: scanning a value that does not fit in
uintreturns an error (#4081) by @MokiMeow, andCmd.Int()rejects an out-of-range integer reply (#4256) by @b84330808 CLIENT INFOvalues: the parser accepts=in values such as the client name andlib-name.ClientInfo()andACLLog()failed on them (#4096) by @LindseyZ1205
Commands and search
- RediSearch:
FT.SEARCHon RESP2 reads the per-document score, payload and sort key correctly withNoContent(#4099) by @jayhemnani9910.EXPLAINSCOREand an emptyRETURNparse correctly (#4140) by @lazerg.FTInforeads fractional doubles on RESP2 (#4207) by @ump45nose and theCASESENSITIVEflag of a TAG field (#4291) by @Dv2Corn.FTCreatesendsSORTABLE,UNFandNOINDEXafter the field options (#4199) by @RaphaelFakhri.FTSearchQueryappliesCountOnlyand keeps the offset (#4268) by @RaphaelFakhri.FTHybridWithArgsalways sends theCOMBINEargument count (#4298) by @lazerg.NewDropIndexBuilder(...).DeleteDocs()does not panic (#4105) by @PragalvaXFREZ niloptions no longer panic:FTExplainWithArgs,FTSynUpdateWithArgsandCFReserveWithArgs(#4248) by @hktitof,HGetEXWithArgsandHSetEXWithArgs(#4214) by @LindseyZ1205.JSONGetWithArgswithniloptions sends the paths (#4185) by @LindseyZ1205- Argument order and count:
IGNOREis sent beforeLABELSin the five time-series builders that support it (for exampleTSAddWithArgsandTSCreateWithArgs), becauseLABELStakes the rest of the arguments (#4160) by @yuefdev.ModuleLoadexsendsARGSonce (#4191) by @LindseyZ1205.HSetandHMSetflatten typedmap[string]Targuments such asmap[string]int(#4235) by @ump45nose - Sub-millisecond timeouts:
XRead,XReadGroup,XClaim,WaitandWaitAOFno longer send a positive timeout shorter than 1 ms as0(wait forever) (#4292) by @Dv2Corn - Geo queries:
GeoRadiusandGeoRadiusByMemberno longer change the caller's*GeoRadiusQuery, so the second call with the same query works (#4173) by @LindseyZ1205 - Scripts: a queued
SCRIPT LOAD(in a pipeline) no longer gives an empty digest toNewScriptServerSHA(#4226) by @ump45nose HOTKEYS: the CPU time fields use the names that the server sends (#4206) by @ump45nose- Struct scan: the value passed to a
TextUnmarshalerorBinaryUnmarshaleris a copy, so an unmarshaler that decodes in place cannot change the reply (#4078) by @saddamr3e
Observability
redisotel-native:server.portno longer contains the pool id (for example6379_1) (#4086) by @zhechen-cs. The connection count includes connections that existed beforeInit(#4089) by @ninadsutrave. Pending requests and state no longer drift acrossInitandShutdown(#4142) by @ninadsutrave. The pool usage metric does not underflow when pool statistics disagree (#4031) by @andystaples
- Short bulk strings in one write:
Writerwrites the header of a bulk string with one call, and writes the value and CRLF together when the value is 32 bytes or less. Benchmarks ofWriteArgsinto abufio.Writershowed 15% to 31% less time for each command on three CPUs, for example -24% to -26% forGET keyand -27% to -31% for an 8-pairMSET. The bytes on the wire do not change (#4281) by @g4lb - OTel metrics and full duplex: see the full-duplex highlight above (#4269)
- CI images: the test matrix uses Redis 8.10.3 and the 8.12 release candidate (
8.12-rc3) (#4231, #4241, #4264, #4288) by @ndyakov - 32-bit build: a
386CI job runsgo vetand the tests, and the root tests compile for 32-bit (#4139) by @lazerg - Dependencies: the OpenTelemetry SDK and
golang.org/x/netare upgraded in the OTel adapters and examples, to fixgovulncheckfindings (#4087) by @ofekshenawa - Regression tests: a cold-start full-duplex cluster test bounds the number of connections (#4223) by @ndyakov, and a test locks the
MSETEXmulti-shard split (#4314) by @Zoomish - Test structure and flaky specs: the autopipeline tests are consolidated from 28 files into 5 (#4091), and some tests move to the standard
testingpackage (#4085, #4187). Fixes for flaky or Redis Enterprise-incompatible specs: #4172, #4180, #4210, #4211, #4215, #4218, #4255, #4260, #4270, #4307
We'd like to thank all the contributors who worked on this release!
@AdamMagued, @aditya-rai-5, @andystaples, @aozmekik, @Avv123, @b84330808, @CaliLuke, @cpoole, @dunglas, @Dv2Corn, @g4lb, @Grivn, @harshitdeora, @hktitof, @jayhemnani9910, @jjj-n, @khasanovbi, @lazerg, @LindseyZ1205, @meruiden, @MokiMeow, @mtnaskari, @Nacl-HCl, @ndyakov, @ninadsutrave, @nk-batman21, @ofekshenawa, @othoathydrahost, @pcbeingused333, @PerryLink, @PragalvaXFREZ, @Purv-Kabaria, @RaphaelFakhri, @rleungx, @roganartu, @saddamr3e, @Samuel-Sorial, @SergeiSadov, @soujasK, @spicysharkco, @SulimanAbdulrazzaq, @TastyHeadphones, @ump45nose, @VedantMadane, @vladvildanov, @vlady-kotsev, @waw666waw666, @xh123637, @xixi-box, @yamaankhan20, @yuefdev, @zhechen-cs, @Zoomish
Full Changelog: https://github.com/redis/go-redis/compare/v9.23.0...v9.24.0-beta.1
goctl v1.11.0
Requires Go 1.25 or later (previously Go 1.24).
- RPC: add
goctl rpc protoc --client-onlyto generate protobuf files and RPC clients without a server skeleton. Supports multiple services, imports, and streaming; incompatible with--client=false. - API parsing: support hyphen-only path segments and trailing slashes in
@serverprefixes; make imported API group ordering deterministic; correct line tracking in block comments. - Java generation: map API
int16fields to Javaint. - Dependencies: update go-zero to
v1.11.0and refresh CLI dependencies.
@Icarus9913, @racequite, @loveulvu, @dhy-ui, @waterWang, @guoshengfei, @kediyalua, @TastyHeadphones, @reheptin, @littfed, @lowgame, @SulimanAbdulrazzaq, @leehainuo, @fzlzjerry, @prostomarkeloff, @failsafesecurity, @amirzre, @kevin9327, @hainuoli — thank you for your first contributions! 🎉
Full Changelog: https://github.com/zeromicro/go-zero/compare/tools/goctl/v1.10.2...tools/goctl/v1.11.0
v1.79.0
v1.79.0 adds a WebSocket server and client package and direct access to HTTP trailer values. It also fixes cross-stream data leaks in compression, strengthens request forwarding and HTTP framing, and improves shutdown, multipart streaming, and static-file cache isolation.
- A new WebSocket package supports servers and clients.
github.com/valyala/fasthttp/websocketprovidesAccept,Dial, context-based reads and writes, streaming message readers and writers, ping handling, and close handshakes. Optional permessage-deflate supports both compression modes, with and without context takeover; compression is disabled by default. The default message limit is 4 MiB.Readreturns connection-owned data valid until the nextReadorReadercall. Follow-up fixes correct URL credential decoding and connection closing, and reduce buffer sizes for large messages. #2493, #2545 - Trailer values can be read separately from upfront headers.
RequestHeaderandResponseHeadernow exposePeekTrailerandPeekAllTrailer. These search only the trailer section, so an upfront header with the same name is not mistaken for a trailer. For streamed bodies, received trailers are available after the body reaches EOF. #2534
- Pooled compression state no longer leaks data between streams. Stackless writers always complete
CloseandReset, including when the worker queue is full. Stackless zstd encoding finishes its writes before output buffers are released, and pooled zstd decoding cannot return another caller's output after malformed input. #2555, #2554, #2564 - Compression retains ownership of the data it still uses. Response compression is skipped after a handler times out. File readers and streamed requests remain alive until compression finishes, including when the response is discarded or a client disconnects during a write. This prevents premature pool reuse while a compression goroutine still holds references. #2559, #2560, #2565
- Forwarded requests preserve the host and resource checked by the server. Slash-prefixed targets retain the supplied Host, absolute request targets retain their authority across path rewrites, and adapted
net/httprequests use the same resource interpretation as fasthttp. Incoming request authorities containing userinfo are rejected before server callbacks run; client-constructed URLs still support credentials. #2572, #2575, #2580, #2579 - Replacement and redirect handling remove stale sensitive values. Setting a header, cookie, or argument replaces later duplicates rather than leaving old values behind. Redirect credential stripping handles every header-name casing, including trailers, and a POST changed to GET after a 301 or 302 no longer forwards its body. Empty request-cookie names also survive serialization when their values contain
=, preventing a nameless cookie from becoming a named one. #2570, #2574, #2571, #2586 - Request parsing rejects ambiguous content types and excessive chunk overhead. Conflicting
Content-Typevalues are rejected before reading the body; identical repeats remain accepted. Chunk parsing bounds optional padding on individual size lines and excess framing overhead across chunks, applying the same limits to buffered bodies, streams, and unread-body drains. #2576, #2573 - Multipart forwarding and shared compression caches preserve isolation. Re-serializing a parsed multipart form rejects decoded content that would introduce a delimiter and create additional parts. Generated compressed files in a shared
CompressRootare separated by source root, preventing oneFShandler from serving another root's cached content. Existing flat cache entries are regenerated on demand. #2581, #2584
- Connection reuse respects message boundaries. Empty GET and HEAD requests clear stale body framing, timeout responses to HEAD omit the body, and broken request chunks cause the connection to close even when the error is encountered while writing a streamed response. HTTP clients close connections after
101 Switching Protocolsinstead of reusing them for another HTTP request. #2562, #2568, #2569, #2566 - Shutdown closes stalled first requests. Connections still reading their first request are closed during shutdown once the five-second grace period from acceptance has passed. Requests already in a handler and later keep-alive requests retain their existing shutdown behavior. Remote-address overrides are also cleared between keep-alive requests. #2536, #2582
- Multipart uploads follow the configured streaming behavior. With request streaming enabled, fixed-length multipart uploads above
MaxRequestBodySizeremain on the body stream so the handler can enforce its own limit before form buffering or temporary-file creation. TimedPipelineClientrequests preserve pre-parsed uploads when copying work for asynchronous execution. #2583, #2563 - Adapted handlers clean up and terminate responses correctly. Writes after hijacking are discarded without touching released buffers, invalid status codes abort the response, and multipart temporary files are removed when the adapted handler returns. #2567, #2577, #2578
Other fixes report io.ErrShortWrite from affected writers and compression helpers, separate IPv4-only and dual-stack DNS cache entries, support HTTP proxy URLs with a trailing slash, and correct generated directory links, modification-time handling, and Windows CONNECT redirects. The Server.MaxRequestBodySize documentation now explains that buffered requests can reserve memory from the declared body size before payload data arrives.
Buffered chunk sizes are parsed directly instead of using one ReadByte call per digit. In the PR's Apple M5 benchmarks, two-chunk responses took about 10% less time, two-chunk requests 9% less time, and bodies with 200 one-byte chunks 17% less time. Results varied by platform and code layout; readers delivering one byte per call were 2–3% slower on the tested AMD EPYC system. These are focused PR measurements, not a release-wide comparison. #2539
The new WebSocket implementation also reduces excess buffer capacity for large messages. In the follow-up PR's examples, reading a compressed 4 MiB message used a 4 MiB buffer instead of 16 MiB, and compressing 1 MiB of repetitive text used a 64 KiB output buffer instead of 2 MiB. #2545
- Add a WebSocket package by @h2zi in https://github.com/valyala/fasthttp/pull/2493
- feat(header): add trailer value accessors by @ZXLyyds100 in https://github.com/valyala/fasthttp/pull/2534
- perf: parse buffered chunk size digits without ReadByte calls by @g4lb in https://github.com/valyala/fasthttp/pull/2539
- websocket: follow-up fixes and smaller buffers for large messages by @h2zi in https://github.com/valyala/fasthttp/pull/2545
- fix: prevent asynchronous zstd writes to pooled buffers by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2554
- fix(stackless): prevent cross-stream data leaks under load by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2555
- Skip response compression after a handler times out by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2559
- Keep FS readers alive until response compression finishes by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2560
- Prevent pooled zstd decoders from returning previous output by @erikdubbelboer in https://github.com/valyala/fthttp/pull/2564
- Keep streamed requests alive after a compressed response write fails by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2565
- Keep the Host header for slash-prefixed request targets by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2572
- Reject conflicting request Content-Type headers by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2576
- Bound chunk extension overhead when reading HTTP bodies by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2573
- Keep the absolute request target host across path rewrites by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2575
- Strip redirect credentials regardless of header name casing by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2574
- Replace duplicate values when setting a header, cookie or argument by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2570
- Drop the POST body when following a 301 or 302 as GET by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2571
- Keep adapted requests on the resource checked by fasthttp by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2580
- Preserve empty request cookie names when values contain an equals sign by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2586
- Isolate shared FS compression caches by source root by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2584
- Reject multipart delimiters in decoded part content by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2581
- Reject userinfo in incoming HTTP request authorities by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2579
- fix: report io.ErrShortWrite from WriteTo implementations by @CJstate in https://github.com/valyala/fasthttp/pull/2541
- fix: report io.ErrShortWrite from stackless compression helpers by @CJstate in https://github.com/valyala/fasthttp/pull/2543
- fix: report io.ErrShortWrite from fsSmallFileReader.WriteTo by @CJstate in https://github.com/valyala/fasthttp/pull/2542
- fix: close connections still reading their first request during Shutdown by @tony1233200 in https://github.com/valyala/fasthttp/pull/2536
- Correct stale framing on empty GET and HEAD requests by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2562
- Forward pre-parsed multipart forms in timed pipeline requests by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2563
- Close HTTP client connections after switching protocols by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2566
- Suppress timeout response bodies for HEAD requests by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2568
- Close connections when streamed responses encounter broken request chunks by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2569
- Reset the remote address override between keep-alive requests by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2582
- Stream multipart uploads above the request body threshold by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2583
- fasthttpadaptor: discard response writes after hijacking by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2567
- Remove multipart upload files when an adapted handler returns by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2578
- Abort adapted responses with invalid status codes by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2577
- fix(fasthttpproxy): dial an HTTP proxy whose URL has a trailing slash by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2548
- fix: keep the DNS cache entries of Dial and DialDualStack apart by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2552
- fix(fs): percent-encode the links of generated index pages by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2550
- fix(fs): ignore If-Modified-Since for files without a modification time by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2549
- Keep Windows URI paths rooted for CONNECT redirects by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2561
- Document request body preallocation on Server.MaxRequestBodySize by @erikdubbelboer in https://github.com/valyala/fasthttp/pull/2585
- chore(deps): bump golang.org/x/sys from 0.49.0 to 0.50.0 by @dependabot[bot] in https://github.com/valyala/fasthttp/pull/2544
- chore(deps): bump github.com/klauspost/compress from 1.20.3 to 1.20.4 by @dependabot[bot] in https://github.com/valyala/fasthttp/pull/2553
- @ZXLyyds100 made their first contribution in https://github.com/valyala/fasthttp/pull/2534
- @g4lb made their first contribution in https://github.com/valyala/fasthttp/pull/2539
- @CJstate made their first contribution in https://github.com/valyala/fasthttp/pull/2541
- @Dv2Corn made their first contribution in https://github.com/valyala/fasthttp/pull/2548
- @tony1233200 made their first contribution in https://github.com/valyala/fasthttp/pull/2536
Full Changelog: https://github.com/valyala/fasthttp/compare/v1.78.0...v1.79.0
v1.14.0
Bugfixes and a new top-level NewDocumentFromReaderWithOptions constructor to pass html parser options (such as parsing with javascript disabled).
v4.16.5
Security
- Proxy middleware: a client could remove
X-Forwarded-Protofrom the upstream request by naming it in theConnectionheader, on plain HTTP requests and WebSocket upgrades. The proxy now setsX-Forwarded-Protoagain after Go removes hop-by-hop headers, as it already does forX-Real-IP. Fixes GHSA-h6x5-phvw-c55c. Reported by zachary-satterly.
Behavior change
A custom balancer that replaces the request and sets its own X-Forwarded-Proto no longer reaches the upstream with that value; the proxy uses the scheme of the original request. A custom ProxyConfig.Transport can still set the header.
No public API, dependency or minimum Go-version changes; Go 1.26 or later remains required.
v5.4.6
Security
- Proxy middleware: a client could remove
X-Forwarded-Protofrom the upstream request by naming it in theConnectionheader, on plain HTTP requests and WebSocket upgrades. The proxy now setsX-Forwarded-Protoagain after Go removes hop-by-hop headers, as it already does forX-Real-IP. Fixes GHSA-h6x5-phvw-c55c. Reported by zachary-satterly.
Behavior change
A custom balancer that replaces the request and sets its own X-Forwarded-Proto no longer reaches the upstream with that value; the proxy uses the scheme of the original request. A custom ProxyConfig.Transport can still set the header.
No public API, dependency or minimum Go-version changes.
v1.11.0
Requires Go 1.25 or later (previously Go 1.24).
- RPC authentication: reject unknown apps and Redis lookup failures regardless of
StrictControl, which is now deprecated. (#5848) - CORS: preserve origin restrictions when adding headers, replacing routers, or serving files. Wildcard origins no longer allow credentials; configure explicit trusted origins for credentialed requests. (#5867)
- JWT authentication: cap request-body reads during failure logging to prevent unbounded gzip decompression. (#5865)
- Kubernetes discovery: exclude endpoints marked not ready, retain addresses across EndpointSlices, and clarify RBAC errors.
- File and stream readers: correct EOF, long-line, and trailing-newline handling; close redirected pipes on restore.
- Redis: make
ZaddnxFloatuseZADD NXsemantics. - Allow timer resets after draining; refresh immutable resources on every access when the interval is zero.
- Preserve YAML null values and upstream gateway
Content-Typeheaders; fix a circuit-breaker data race. - Update framework dependencies.
@Icarus9913, @racequite, @loveulvu, @dhy-ui, @waterWang, @guoshengfei, @kediyalua, @TastyHeadphones, @reheptin, @littfed, @lowgame, @SulimanAbdulrazzaq, @leehainuo, @fzlzjerry, @prostomarkeloff, @failsafesecurity, @amirzre, @kevin9327, @hainuoli — thank you for your first contributions! 🎉