Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/snclient/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions pkg/snclient/snclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please ask question in the PR or directly, not in the code.

log.Debugf("module name: %s bindString: %s", name, listener.BindString())
name += listener.BindString()
}

err = modules.Add(name, mod)
Expand Down
Loading