You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cnservice bootstrap panics on context.Canceled instead of returning error #24064
cnservice.(*service).bootstrap() at pkg/cnservice/server.go:944-945 panics on ANY bootstrap error, including context.Canceled and context.DeadlineExceeded. This causes unrecoverable crashes instead of graceful error propagation when the bootstrap timeout expires or the service context is canceled during shutdown.
Panics on all errors, but context cancellation/timeout is NOT a bootstrap failure — it's an external signal that the operation should stop.
Inconsistency
The same file already handles context.Canceled gracefully for BootstrapUpgrade (line 955):
iferr!=context.Canceled {
// only log non-cancel errors
}
But initial Bootstrap does not have this guard.
Impact
All embedded cluster tests with multiple CNs can fail with panic: context canceled when bootstrap takes longer than 5 minutes
Tests affected: TestBasicCluster, Test_TxnExecutorExec, TestPartitionBasedShardCanBeCreated, TestDeleteAndSelect, TestCreateAndDropPitr, Test_UpgradeEntry, TestAffectedRows, TestCompile, and more
In production, this could crash a CN process during graceful shutdown
Additional Issue
pkg/embed/cluster.go:doStartLocked() also panics on CN Start() errors instead of propagating them, preventing callers from handling startup failures gracefully.
Proposed Fix
Check for context cancellation/timeout before panicking in bootstrap
Return error instead of panicking for context-related failures
Change doStartLocked() to propagate errors instead of panicking
Activity
fix: cnservice bootstrap panics on context.Canceled instead of return…
fix: bootstrap panic on context.Canceled + error handling in cluster …