Skip to content

[client] Fix error handling case of flow grpc error #3727

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

Merged
merged 4 commits into from
Apr 25, 2025

Conversation

pappz
Copy link
Contributor

@pappz pappz commented Apr 23, 2025

Describe your changes

When a gRPC error occurs in the Flow package, it will be propagated to the upper layers and handled similarly to a Management gRPC error.

  • Always report a disconnected state in the event of any error
  • Hide the underlying gRPC errors
  • Force close the gRPC connection in the event of any error

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 13:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the gRPC error handling in the Flow package by ensuring that any error from the stream is correctly propagated while also hiding underlying gRPC error details. In addition, it now closes the gRPC connection if it isn’t already shut down and triggers a disconnection notification on encountering an error.

  • Propagate stream errors after attempting to close the connection
  • Centralize the call to notifyDisconnected in the error branch of the stream handler
  • Wrap error return values in receiveEvents to hide gRPC error codes
Comments suppressed due to low confidence (1)

management/client/grpc.go:270

  • [nitpick] Wrapping the error with fmt.Errorf using only the error message may obscure useful debugging context. Consider using error wrapping with '%w' or adding context if that aligns with the intent to hide underlying gRPC error details.
return fmt.Errorf("%v", err.Error())

Copy link

@pappz pappz merged commit 2817f62 into main Apr 25, 2025
35 checks passed
@pappz pappz deleted the fix/mgm-connection-state branch April 25, 2025 07:26
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