-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-9706: Fix FTDC tracking of module restarts/crashes. #4695
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -867,6 +867,10 @@ func (mgr *Manager) newOnUnexpectedExitHandler(mod *module) func(exitCode int) b | |
"error", err) | ||
} | ||
|
||
if mgr.ftdc != nil { | ||
mgr.ftdc.Remove(mod.getFTDCName()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bug fix for modules crashing -- this was just missing altogether before. |
||
} | ||
|
||
// If attemptRestart returns any orphaned resource names, restart failed, | ||
// and we should remove orphaned resources. Since we handle process | ||
// restarting ourselves, return false here so goutils knows not to attempt | ||
|
@@ -1225,7 +1229,7 @@ func (m *module) stopProcess() error { | |
// of metrics will be reported. Therefore it is safe to continue monitoring the module process | ||
// while it's in shutdown. | ||
if m.ftdc != nil { | ||
m.ftdc.Remove(m.process.ID()) | ||
m.ftdc.Remove(m.getFTDCName()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The happy path for a stop -> restart (presumably a module upgrade falls into this category). |
||
} | ||
}() | ||
|
||
|
@@ -1347,6 +1351,10 @@ func (m *module) getFullEnvironment(viamHomeDir string) map[string]string { | |
return getFullEnvironment(m.cfg, m.dataDir, viamHomeDir) | ||
} | ||
|
||
func (m *module) getFTDCName() string { | ||
return fmt.Sprintf("proc.modules.%s", m.process.ID()) | ||
} | ||
|
||
func (m *module) registerProcessWithFTDC() { | ||
if m.ftdc == nil { | ||
return | ||
|
@@ -1364,7 +1372,7 @@ func (m *module) registerProcessWithFTDC() { | |
return | ||
} | ||
|
||
m.ftdc.Add(fmt.Sprintf("proc.modules.%s", m.process.ID()), statser) | ||
m.ftdc.Add(m.getFTDCName(), statser) | ||
} | ||
|
||
func getFullEnvironment( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by to document the "help" output for something I added in a prior PR.