Repository navigation
fix: k8sinit handler setters, swallowed init errors, future double resolve, nil service - #1
Merged
Merged
Conversation
…solve, nil service - k8sinit: SetHealthHandler/SetTelemetryHandler always failed with ErrAlreadyInitialized because New() pre-filled the noop handlers and the setters used nil as the "not set" flag. Track "set" with explicit flags. - BaseOverloadedTask (and so WrapTask, BaseWrappedTask, futuretask) now forwards TaskInitError, so init errors of wrapped tasks are reported by Manager.AddTask instead of panicking/failing at runtime. - Future: a second Resolve/ResolveError mutated the resolved value before panicking, racing with readers. Check for "already resolved" first. - Manager.AddService(nil) now reports ErrNilTask instead of panicking in the start step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLyyJx24FhyAuthMeMuKPx
- New() rejects duplicate stage names (they made each task run its steps twice and fail with ErrInvalidStepOrder). - Stages(), WithStages() and DefaultTaskSteps() no longer share slices with callers; DefaultTaskSteps() exposed the package-level step order. - BuildTask(WithParent(p)) with no own step callbacks is valid again (previously ErrNilTask), and SetParent no longer drops the nil-step init error. Simplify taskBuild.Run to load the parent once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLyyJx24FhyAuthMeMuKPx
- Remove unused helpers (sliceMap, sliceFilter, stringerIter, instancetask runStep, k8sinit nullLogger); move ptr to tests. - multiErrorBuilder.build reuses buildMultiErrors; nullLogger is a plain var. - run.go: drop redundant SSM check, pass the step logger instead of rebuilding it; task callbacks no longer allocate a concatenated slice. - AddTask validates the stage before building the wrapper. - instancetask loads task data once per step. - health_http: one helper builds the three probe handlers; drop the default server handler that was always overwritten. - Fix go vet unkeyed-field warning in futuretask and a wrong interface assertion in default.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLyyJx24FhyAuthMeMuKPx
…, use 503 - New optional TaskWithNotRun interface: Manager.Run notifies tasks in stages that will never run (after a setup failure, or when Run returns before any stage runs). futuretask resolves its future with ErrTaskNotRun, so Value() waiters no longer block forever and hold up shutdown. BaseOverloadedTask forwards it, so wrapped tasks keep working. - AddInitError after Run started now starts the shutdown with the error as cause, like AddTask, instead of silently dropping it. - health_http: readiness probe returns 503 Service Unavailable while terminating instead of the non-standard 499. Add handler tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLyyJx24FhyAuthMeMuKPx
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.
ErrAlreadyInitialized because New() pre-filled the noop handlers and the
setters used nil as the "not set" flag. Track "set" with explicit flags.
forwards TaskInitError, so init errors of wrapped tasks are reported by
Manager.AddTask instead of panicking/failing at runtime.
panicking, racing with readers. Check for "already resolved" first.
the start step.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01CLyyJx24FhyAuthMeMuKPx