Fix download_rate as string on checkin handling#5176
Fix download_rate as string on checkin handling#5176michel-laterman merged 9 commits intoelastic:mainfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
|
Marking this back as a draft, I wasn't confident in the fix and have added an e2e test that shows it's still failing |
|
Current example of this error in a support case:
|
|
buildkite test this |
|
blakerouse
left a comment
There was a problem hiding this comment.
Looks good.
Nice coverage on the tests.
|
@Mergifyio backport 8.17 8.18 8.19 9.0 9.1 |
✅ Backports have been createdDetails
|
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9)
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9)
…#5191) * Fix download_rate as string on checkin handling (#5176) Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go * Fix merge --------- Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com> Co-authored-by: michel-laterman <michel.laterman@elastic.co>
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
#5188) * Fix download_rate as string on checkin handling (#5176) Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go * Fix merge * Add upgrade response body for errors --------- Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com> Co-authored-by: michel-laterman <michel.laterman@elastic.co>
#5189) * Fix download_rate as string on checkin handling (#5176) Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) # Conflicts: # testing/e2e/scaffold/scaffold.go * Fix merge * Add upgrade response body for errors --------- Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com> Co-authored-by: michel-laterman <michel.laterman@elastic.co>
| } | ||
| if err := details.Metadata.FromUpgradeMetadataDownloading(upgradeDetails); err != nil { | ||
| vSpan.End() | ||
| return fmt.Errorf("%w %s: unable to repack metadata: %w", ErrInvalidUpgradeMetadata, UpgradeDetailsStateUPGDOWNLOADING, err) |
There was a problem hiding this comment.
Sorry for the late review, but the root cause one layer up from this is we consider parsing upgrade details to be a fatal error and it isn't. Upgrade details are nice to have.
#5190) * Fix download_rate as string on checkin handling (#5176) Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's download_rate as a string instead of float64. (cherry picked from commit c94d8d9) * Add upgrade response body for errors * change upgrade version --------- Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com> Co-authored-by: michel-laterman <michel.laterman@elastic.co>




What is the problem this PR solves?
Fix fleet-server to properly handle when an agent sends the upgrade downloading detail's
download_rateas a string instead of float64.How does this PR solve the problem?
Fleet-server will parse the string into a float representing bps and re-marshal the metadata.
Design Checklist
I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolRelated issues