Skip to content
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

Redfish override timeout for FirmwareInstall #337

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

joelrebel
Copy link
Member

What does this PR implement/change/remove?

  • Adds a remaining timeout check on the Redfish provider FirmwareInstall method.
  • Overrides the Redfish wrapper HTTP client timeout for the FirmwareInstall method.

The Redfish wrapper client - Gofish has a context timeout on the HTTP client set when Open() is invoked, this timeout value is often insufficient for the FirmwareInstall method to complete successfully, and so the FirmwareInstall method overrides this timeout value and restores it when done.

Checklist

  • Tests added
  • Similar commits squashed

Description for changelog/release notes

 - Require a higher context timeout value before proceeding with FirmwareInstall.
 - Set http client timeout to the one passed in through the context to FirmwareInstall.

@joelrebel joelrebel changed the title Redfish override timeout Redfish override timeout for FirmwareInstall Jul 11, 2023
joelrebel added a commit to metal-toolbox/flasher that referenced this pull request Jul 11, 2023
This fixes the issue where the FirmwareInstall step on BMCs with Redfish
have too little time to complete because of the way the Gofish Redfish
driver used in bmclib sets timeouts.

related bmc-toolbox/bmclib#337
// this gives the BMC enough time to have the firmware uploaded and return a response to the client.
ctxDeadline, _ := ctx.Deadline()
if time.Until(ctxDeadline) < 10*time.Minute {
return "", errors.Wrap(errInsufficientCtxTimeout, " "+time.Until(ctxDeadline).String())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the operational impact of this error? Is this something we expect to have retried? Would we expect a retry to work? Does an exit here leave the BMC in a sane state?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in with all bmclib functions, its upto the caller to retry with a higher timeout value and/or to close the bmc connection. We provide examples for invoking these methods - https://github.com/bmc-toolbox/bmclib/blob/main/examples/install-firmware/main.go

@joelrebel joelrebel requested a review from DoctorVin July 12, 2023 13:33
joelrebel added a commit to metal-toolbox/flasher that referenced this pull request Jul 12, 2023
This fixes the issue where the FirmwareInstall step on BMCs with Redfish
have too little time to complete because of the way the Gofish Redfish
driver used in bmclib sets timeouts.

related bmc-toolbox/bmclib#337
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 61.53% and project coverage change: +0.07 🎉

Comparison is base (13adab0) 42.59% compared to head (c13e347) 42.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
+ Coverage   42.59%   42.67%   +0.07%     
==========================================
  Files          44       44              
  Lines        3679     3691      +12     
==========================================
+ Hits         1567     1575       +8     
- Misses       1933     1937       +4     
  Partials      179      179              
Impacted Files Coverage Δ
internal/redfishwrapper/client.go 20.22% <0.00%> (-0.96%) ⬇️
providers/supermicro/firmware.go 0.00% <0.00%> (ø)
providers/redfish/firmware.go 47.01% <100.00%> (+2.96%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@joelrebel joelrebel merged commit a1b87e2 into main Jul 14, 2023
7 checks passed
@joelrebel joelrebel deleted the redfish-override-timeout branch July 14, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants