From a6d8f172f43317e8781edf94ba5b9c8cb1f5b2a2 Mon Sep 17 00:00:00 2001 From: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> Date: Wed, 12 Apr 2023 20:01:19 -0400 Subject: [PATCH] RSDK-2551 Swallow 143 errors when stopping modules for now (#2208) --- module/modmanager/manager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/modmanager/manager.go b/module/modmanager/manager.go index 1aef25b9f92..7da3087dea8 100644 --- a/module/modmanager/manager.go +++ b/module/modmanager/manager.go @@ -6,6 +6,7 @@ import ( "io/fs" "os" "path/filepath" + "strings" "sync" "time" @@ -34,6 +35,7 @@ import ( var ( validateConfigTimeout = 5 * time.Second + errMessageExitStatus143 = "exit status 143" errModularResourcesDisabled = errors.New("modular resources disabled in untrusted environment") ) @@ -462,7 +464,10 @@ func (m *module) stopProcess() error { return nil }) - if err := m.process.Stop(); err != nil { + // TODO(RSDK-2551): stop ignoring exit status 143 once Python modules handle + // SIGTERM correctly. + if err := m.process.Stop(); err != nil && + !strings.Contains(err.Error(), errMessageExitStatus143) { return err } return nil