From a87cd5bbaae90eb57611cf21557a92b24e7f0be3 Mon Sep 17 00:00:00 2001 From: Ahmet Oeztuerk Date: Mon, 17 Nov 2025 15:54:32 +0100 Subject: [PATCH] - made the errors when starting a module fatal - if the module is of type RequestHandler, the name was replaced with the binding address. Append that binding string instead of replacing. --- pkg/snclient/module.go | 6 +++--- pkg/snclient/snclient.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/snclient/module.go b/pkg/snclient/module.go index 1c1b5d2a..dbe81091 100644 --- a/pkg/snclient/module.go +++ b/pkg/snclient/module.go @@ -80,11 +80,11 @@ func (ms *ModuleSet) startModule(name string) { err := module.Start() if err != nil { - log.Errorf("failed to start %s %s module: %s", name, ms.name, err.Error()) + // A module failing to start is a fatal error. + // Do not try to start it again and again with timeouts, just report the error and quit the program. module.Stop() delete(ms.modules, name) - - return + log.Fatalf("Exiting snclient, failed to start module on modeset: %s , module key: %s , error: %s", ms.name, name, err.Error()) } log.Tracef("module %s started", name) diff --git a/pkg/snclient/snclient.go b/pkg/snclient/snclient.go index 1848392f..a216a028 100644 --- a/pkg/snclient/snclient.go +++ b/pkg/snclient/snclient.go @@ -592,8 +592,9 @@ func (snc *Agent) initModules(name string, loadable []*LoadableModule, runSet *A name := entry.Name() if listener, ok := mod.(RequestHandler); ok { - name = listener.BindString() - log.Debugf("bind: %s", name) + // If it can be converted into a Requesthandler, the name changes. Why? Is it later used to parse the port or hostname? + log.Debugf("module name: %s bindString: %s", name, listener.BindString()) + name += listener.BindString() } err = modules.Add(name, mod)