From fd9f32dc48455fae3268ac1a444c011bde4768b7 Mon Sep 17 00:00:00 2001 From: jupiterv2 Date: Thu, 18 Jun 2026 21:26:59 +0800 Subject: [PATCH] fix(driver): surface the real startup failure instead of swallowing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When startup's main() failed at the "get processor" step, the error was lost: Main() discarded main()'s returned error (`exitCode, _ := main(...)`) and only logged a generic "startup failed, will retry", and getProcessor returned the wrapped error before the meta-state error-logging defer was registered — so nothing logged the cause. A crash-looping driver showed only the retry line with no reason. - Main() now keeps main()'s error and logs it on the retry line (Infofe). - getProcessor logs explicitly on both the GetProcessorWithProject RPC error and the FromPB error. Co-Authored-By: Claude Opus 4.8 (1M context) --- driver/controller/startup/startup.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/driver/controller/startup/startup.go b/driver/controller/startup/startup.go index f0b721e..e994f1a 100644 --- a/driver/controller/startup/startup.go +++ b/driver/controller/startup/startup.go @@ -144,10 +144,12 @@ func (c *baseStartupController) getProcessor(ctx context.Context) error { req := &protossvc.GetProcessorRequest{ProcessorId: c.config.ProcessorID} response, err := c.processorClient.GetProcessorWithProject(ctx, req) if err != nil { + logger.Errorfe(err, "get processor failed") return err } var p models.Processor if err = p.FromPB(response.Processor); err != nil { + logger.Errorfe(err, "get processor failed") return err } p.Project = &commonmodels.Project{} @@ -573,7 +575,7 @@ func Main(config Config) { const retryInterval = time.Second * 30 ctx, logger := log.FromContext(concurrency.NewSignalContext(context.Background()), "processorID", config.ProcessorID) for { - exitCode, _ := main(ctx, config) + exitCode, err := main(ctx, config) if exitCode < 0 { logger.Warnf("do not use all streaming mode") return @@ -583,7 +585,7 @@ func Main(config Config) { os.Exit(int(exitCode)) } - logger.Infof("startup failed, will retry after %s", retryInterval.String()) + logger.Infofe(err, "startup failed, will retry after %s", retryInterval.String()) select { case <-time.After(retryInterval): case <-ctx.Done():