diff --git a/.version b/.version index 34aae15..359c410 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.31.0 +1.32.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 616be08..219de8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.32.0] - 2024-04-29 + +- Updated timeout for Paradise updates redfish calls to 120 seconds + ## [1.31.0] - 2024-04-16 - Fixed loader zip file error diff --git a/cmd/hms-firmware-action/main.go b/cmd/hms-firmware-action/main.go index c23f0cb..87d5819 100644 --- a/cmd/hms-firmware-action/main.go +++ b/cmd/hms-firmware-action/main.go @@ -70,7 +70,7 @@ const manufacturerFoxconn = "foxconn" const ( dfltMaxHTTPRetries = 5 - dfltMaxHTTPTimeout = 40 + dfltMaxHTTPTimeout = 120 dfltMaxHTTPBackoff = 8 ) const defaultS3Endpoint = "s3" diff --git a/cmd/hms-firmware-action/updateScheduler.go b/cmd/hms-firmware-action/updateScheduler.go index 3906197..a7dbe64 100644 --- a/cmd/hms-firmware-action/updateScheduler.go +++ b/cmd/hms-firmware-action/updateScheduler.go @@ -641,7 +641,7 @@ func doLaunch(operation storage.Operation, image storage.Image, command storage. mainLogger.Debug(operation.HsmData.UpdateURI) mainLogger.Debug(pcs) passback = SendSecureRedfish(globals, operation.HsmData.FQDN, operation.HsmData.UpdateURI, - pcs, operation.HsmData.User, operation.HsmData.Password, "POST") + pcs, operation.HsmData.User, operation.HsmData.Password, "POST", 120) if !(passback.IsError || passback.StatusCode >= 400) { // Foxconn return a link to a task which we can monitor for update progress tasklink := new(model.TaskLink) @@ -1080,7 +1080,13 @@ func fileCheck(fileLocation string) (returnLocation string, err error) { } func SendSecureRedfish(globals *domain.DOMAIN_GLOBALS, server string, path string, bodyStr string, authUser string, - authPass string, method string) (pb model.Passback) { + authPass string, method string, timeout_override ...int) (pb model.Passback) { + + timeout := 40 + if len(timeout_override) > 0 { + timeout = timeout_override[0] + } + mainLogger.WithFields(logrus.Fields{"Timeout": timeout}).Debug("TIMEOUT SETTING") tmpURL, _ := url.Parse("https://" + server + path) req, err := http.NewRequest(method, tmpURL.String(), bytes.NewBuffer([]byte(bodyStr))) @@ -1093,7 +1099,7 @@ func SendSecureRedfish(globals *domain.DOMAIN_GLOBALS, server string, path strin if !(authUser == "" && authPass == "") { req.SetBasicAuth(authUser, authPass) } - reqContext, _ := context.WithTimeout(context.Background(), time.Second*40) + reqContext, _ := context.WithTimeout(context.Background(), time.Second*time.Duration(timeout)) req = req.WithContext(reqContext) if err != nil { mainLogger.Error(err) diff --git a/internal/domain/version.go b/internal/domain/version.go index a33e3f0..cc69d94 100644 --- a/internal/domain/version.go +++ b/internal/domain/version.go @@ -1,7 +1,7 @@ /* * MIT License * - * (C) Copyright [2020-2021] Hewlett Packard Enterprise Development LP + * (C) Copyright [2020-2024] Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -477,6 +477,11 @@ func RetrieveTaskStatus(hd *hsm.HsmData, tasklink string) (stateStatus model.Tas logrus.Error(err) return } + if resp.StatusCode >= 400 { + err = fmt.Errorf("Task Status Code: %d", resp.StatusCode) + logrus.Error(err) + return + } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body)