Repository navigation
Add strict replay, join sink cleanup, and update dependencies - #88
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ordinary Reader can continue from available history after its requested position has been trimmed. Callers that need to detect that loss can now use
Stream.NewReplayReader: it checks the existing stream generation, exact retained anchor, and first successor batch together before returning.0-0starts at available history without claiming earlier completeness. Replay creates or repairs no lifecycle state.Callers provide positive event-count and copied-byte limits plus a blocking wait of at least one millisecond.
Anchorreturns the opening entry separately; one unbufferedSubscribechannel delivers complete successors. The caller context owns the observation lifetime.Donesignals finished observation,Errpreserves the terminal cause, andClosecancels and joins the current command and reader loop. Invalid IDs, missing lifecycles, unavailable positions, and oversized events have explicit error categories; malformed data and dependency failures terminate observation.Previously, failed Redis detachment could leave Sink subscriptions and local map readers open, and public Close did not join automatic fatal-read cleanup. Sink now releases those local resources and joins cleanup while retaining the exact failed attachment for a later Close attempt. Pending events remain recoverable;
IsClosedbecomes true only after distributed detachment succeeds. ReviewcloseResourcesandcloseAfterReadalongside the replay script's admission checks.The replay API is additive and uses the existing lifecycle format. Existing Reader behavior is unchanged; this diff adds no storage migration or mixed-version deployment sequence. Rolling back removes the new API and shutdown fix without converting stored data. Byte limits cover copied content, not raw Redis entry or wakeup materialization; deployments must separately admit those costs. Blocking duration is not a total operation deadline.
This PR also updates runtime and test dependencies on their existing module paths, including go-redis 9.22.0, Clue 1.3.0, Goa 3.32.0, Model 1.16.10, OpenTelemetry 1.46.0, and gRPC 1.84.0. Pulse now requires Go 1.26 because several selected dependencies require it. The README records that minimum, and CI is configured for Go 1.26 and 1.27.
Consumers using unset go-redis options inherit a five-second read/write timeout and changed retry backoff; explicitly configured values retain their meaning. Clue now isolates logging options in derived contexts. Consumers using OpenTelemetry’s HTTP
WithEndpointURLshould include the signal path when needed; Pulse’s examples use gRPC exporters. Redis caching and automatic pipelining remain opt-in and are not enabled by this change.With the updated dependency graph, module verification, compilation of all packages and examples, and staticcheck passed on Go 1.26.8. Race tests passed for every test-bearing package: 273 tests and 147 subtests across streaming, replicated maps, semaphores, the worker pool, logging/goroutine helpers, and the weather poller. No tests failed or were skipped; generated example packages without test files were also compiled. The disposable Redis instance was removed after verification. These checks do not run the example services or establish production capacity; the two CI jobs remain to be confirmed.