ocket8888 commented on a change in pull request #4916:
URL: https://github.com/apache/trafficcontrol/pull/4916#discussion_r466683709



##########
File path: traffic_monitor/manager/opsconfig.go
##########
@@ -169,42 +164,26 @@ func StartOpsConfigManager(
                        backoff = 
util.NewConstantBackoff(util.ConstantBackoffDuration)
                }
                for {
-                       realToSession, toAddr, err = 
to.LoginWithAgent(newOpsConfig.Url, newOpsConfig.Username, 
newOpsConfig.Password, newOpsConfig.Insecure, staticAppData.UserAgent, 
useCache, trafficOpsRequestTimeout)
+                       err = toSession.Update(newOpsConfig.Url, 
newOpsConfig.Username, newOpsConfig.Password, newOpsConfig.Insecure, 
staticAppData.UserAgent, useCache, trafficOpsRequestTimeout)
                        if err != nil {
                                handleErr(fmt.Errorf("MonitorConfigPoller: 
error instantiating Session with traffic_ops (%v): %s\n", toAddr, err))
                                duration := backoff.BackoffDuration()
                                log.Errorf("retrying in %v\n", duration)
                                time.Sleep(duration)
 
                                if toSession.BackupFileExists() && 
(toLoginCount >= cfg.TrafficOpsDiskRetryMax) {
-                                       jar, err := cookiejar.New(nil)
-                                       if err != nil {
-                                               log.Errorf("Err getting 
cookiejar")
-                                               continue
-                                       }
-
-                                       realToSession = 
to.NewSession(newOpsConfig.Username, newOpsConfig.Password, newOpsConfig.Url, 
staticAppData.UserAgent, &http.Client{
-                                               Timeout: 
trafficOpsRequestTimeout,
-                                               Transport: &http.Transport{
-                                                       TLSClientConfig: 
&tls.Config{InsecureSkipVerify: true},
-                                               },
-                                               Jar: jar,
-                                       }, useCache)
-                                       toSession.Set(realToSession)
-                                       // At this point we have a valid 
'dummy' session. This will allow us to pull from disk but will also retry when 
TO comes up

Review comment:
       No, but tbh TM already seems broken in that case, from my testing with 
your UI indicator. Have I been doing something wrong? Does it work for you?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to