Fix agent reboot issue caused by session manager module running into panic mode
cr
@@ -182,13 +182,7 @@ func (s *Session) ModuleExecute(context context.T) (err error) {
go s.listenReply(resultChan, instanceId)
- if err = s.processor.InitialProcessing(); err != nil {
- log.Errorf("initial processing in EngineProcessor encountered error: %v", err)
- return
- }
-
log.Info("SSM Agent is trying to setup control channel for Session Manager module.")
- go func() {
s.controlChannel, err = setupControlChannel(s.context, s.service, s.processor, instanceId)
if err != nil {
log.Errorf("Failed to setup control channel, err: %v", err)
@@ -196,10 +190,13 @@ func (s *Session) ModuleExecute(context context.T) (err error) {
}
log.Info("Starting receiving message from control channel")
-
// Create ssm-user since control channel has been successfully created.
s.createLocalAdminUser()
- }()
+
+ if err = s.processor.InitialProcessing(); err != nil {
+ log.Errorf("initial processing in EngineProcessor encountered error: %v", err)
+ return
+ }
return nil
}
