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

Fix gRPC error handling for gateway/filter handler #2669

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

kmrmt
Copy link
Contributor

@kmrmt kmrmt commented Oct 2, 2024

Description

use FromError instead of ParseError

Related Issue

Versions

  • Vald Version: v1.7.13
  • Go Version: v1.23.2
  • Rust Version: v1.81.0
  • Docker Version: v27.3.1
  • Kubernetes Version: v1.31.1
  • Helm Version: v3.16.1
  • NGT Version: v2.2.4
  • Faiss Version: v1.8.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling across several gRPC methods for more robust reporting.
    • Enhanced consistency in error responses, aiding in traceability.
  • Improvements

    • Adjusted logging for better context during error occurrences, facilitating easier debugging.
    • Streamlined error handling logic by removing redundant variables.

Copy link
Contributor

coderabbitai bot commented Oct 2, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes primarily focus on enhancing error handling and logging within the gRPC server methods of the pkg/gateway/filter/handler/grpc/handler.go file. Key updates include improved error parsing using status.FromError(err), consistent error wrapping with additional context, and more detailed logging for better traceability during gRPC calls. These modifications aim to improve the robustness of error reporting and facilitate easier debugging.

Changes

File Path Change Summary
pkg/gateway/filter/handler/grpc/handler.go - Enhanced error handling in multiple methods using status.FromError(err).
- Improved logging to provide detailed context for errors.
- Consistent error responses with additional context like request IDs.
- Removed redundant error message variables.
- Minor adjustments in error message construction and logging.

Possibly related PRs

Suggested labels

size/L

Suggested reviewers

  • hlts2
  • vankichi
  • kpango

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 60ae3f9 and 4bf51e0.

📒 Files selected for processing (1)
  • pkg/gateway/filter/handler/grpc/handler.go (32 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
pkg/gateway/filter/handler/grpc/handler.go

[warning] 239-240: pkg/gateway/filter/handler/grpc/handler.go#L239-L240
Added lines #L239 - L240 were not covered by tests


[warning] 242-242: pkg/gateway/filter/handler/grpc/handler.go#L242
Added line #L242 was not covered by tests


[warning] 285-286: pkg/gateway/filter/handler/grpc/handler.go#L285-L286
Added lines #L285 - L286 were not covered by tests


[warning] 288-288: pkg/gateway/filter/handler/grpc/handler.go#L288
Added line #L288 was not covered by tests


[warning] 467-468: pkg/gateway/filter/handler/grpc/handler.go#L467-L468
Added lines #L467 - L468 were not covered by tests


[warning] 470-470: pkg/gateway/filter/handler/grpc/handler.go#L470
Added line #L470 was not covered by tests


[warning] 517-518: pkg/gateway/filter/handler/grpc/handler.go#L517-L518
Added lines #L517 - L518 were not covered by tests


[warning] 520-520: pkg/gateway/filter/handler/grpc/handler.go#L520
Added line #L520 was not covered by tests


[warning] 699-700: pkg/gateway/filter/handler/grpc/handler.go#L699-L700
Added lines #L699 - L700 were not covered by tests


[warning] 702-702: pkg/gateway/filter/handler/grpc/handler.go#L702
Added line #L702 was not covered by tests


[warning] 758-759: pkg/gateway/filter/handler/grpc/handler.go#L758-L759
Added lines #L758 - L759 were not covered by tests


[warning] 761-761: pkg/gateway/filter/handler/grpc/handler.go#L761
Added line #L761 was not covered by tests


[warning] 939-940: pkg/gateway/filter/handler/grpc/handler.go#L939-L940
Added lines #L939 - L940 were not covered by tests


[warning] 942-942: pkg/gateway/filter/handler/grpc/handler.go#L942
Added line #L942 was not covered by tests


[warning] 997-998: pkg/gateway/filter/handler/grpc/handler.go#L997-L998
Added lines #L997 - L998 were not covered by tests


[warning] 1000-1000: pkg/gateway/filter/handler/grpc/handler.go#L1000
Added line #L1000 was not covered by tests


[warning] 1186-1187: pkg/gateway/filter/handler/grpc/handler.go#L1186-L1187
Added lines #L1186 - L1187 were not covered by tests


[warning] 1189-1189: pkg/gateway/filter/handler/grpc/handler.go#L1189
Added line #L1189 was not covered by tests


[warning] 1244-1245: pkg/gateway/filter/handler/grpc/handler.go#L1244-L1245
Added lines #L1244 - L1245 were not covered by tests


[warning] 1247-1247: pkg/gateway/filter/handler/grpc/handler.go#L1247
Added line #L1247 was not covered by tests


[warning] 1354-1355: pkg/gateway/filter/handler/grpc/handler.go#L1354-L1355
Added lines #L1354 - L1355 were not covered by tests


[warning] 1357-1357: pkg/gateway/filter/handler/grpc/handler.go#L1357
Added line #L1357 was not covered by tests


[warning] 1437-1438: pkg/gateway/filter/handler/grpc/handler.go#L1437-L1438
Added lines #L1437 - L1438 were not covered by tests


[warning] 1440-1440: pkg/gateway/filter/handler/grpc/handler.go#L1440
Added line #L1440 was not covered by tests


[warning] 1526-1527: pkg/gateway/filter/handler/grpc/handler.go#L1526-L1527
Added lines #L1526 - L1527 were not covered by tests


[warning] 1529-1529: pkg/gateway/filter/handler/grpc/handler.go#L1529
Added line #L1529 was not covered by tests


[warning] 1573-1574: pkg/gateway/filter/handler/grpc/handler.go#L1573-L1574
Added lines #L1573 - L1574 were not covered by tests


[warning] 1576-1576: pkg/gateway/filter/handler/grpc/handler.go#L1576
Added line #L1576 was not covered by tests


[warning] 1630-1631: pkg/gateway/filter/handler/grpc/handler.go#L1630-L1631
Added lines #L1630 - L1631 were not covered by tests


[warning] 1633-1633: pkg/gateway/filter/handler/grpc/handler.go#L1633
Added line #L1633 was not covered by tests

🔇 Additional comments (7)
pkg/gateway/filter/handler/grpc/handler.go (7)

285-288: LGTM: Consistent error handling improvement

This change is consistent with the previous error handling improvements.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 285-286: pkg/gateway/filter/handler/grpc/handler.go#L285-L286
Added lines #L285 - L286 were not covered by tests


[warning] 288-288: pkg/gateway/filter/handler/grpc/handler.go#L288
Added line #L288 was not covered by tests


467-470: Consistent error handling improvements across multiple methods

The error handling improvements using status.FromError have been consistently applied across multiple methods in the file. This uniformity in implementation is commendable and enhances the overall code quality and maintainability.

Also applies to: 517-520, 699-702, 758-761, 939-942, 997-1000, 1186-1189, 1244-1247

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 467-468: pkg/gateway/filter/handler/grpc/handler.go#L467-L468
Added lines #L467 - L468 were not covered by tests


[warning] 470-470: pkg/gateway/filter/handler/grpc/handler.go#L470
Added line #L470 was not covered by tests


1354-1357: Consistent error handling in search-related methods

The improved error handling pattern has been consistently applied to various search-related methods. This uniformity enhances the reliability and maintainability of the search functionality across the service.

Also applies to: 1437-1440, 1526-1529, 1573-1576, 1630-1633

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 1354-1355: pkg/gateway/filter/handler/grpc/handler.go#L1354-L1355
Added lines #L1354 - L1355 were not covered by tests


[warning] 1357-1357: pkg/gateway/filter/handler/grpc/handler.go#L1357
Added line #L1357 was not covered by tests


2768-2771: Uniform error handling across diverse operations

The improved error handling pattern has been consistently applied across various operation types, including upsert, remove, and others. This uniformity in implementation across different functionalities contributes to a more cohesive and maintainable codebase.

Also applies to: 2787-2790, 2827-2830, 2917-2920, 2936-2939, 2975-2978


3163-3166: Comprehensive error handling improvement

The improved error handling pattern has been consistently applied throughout the entire file, including this final instance in the StreamGetObject method. This comprehensive update enhances the overall robustness and consistency of the error handling mechanism across all operations in the service.


Line range hint 1-3200: Summary: Comprehensive error handling improvement with test coverage recommendation

The changes in this file represent a significant improvement in error handling across all methods. The consistent replacement of status.ParseError with status.FromError aligns the code with gRPC best practices and potentially improves efficiency.

While the implementation is commendable, it's crucial to address the lack of test coverage for these changes.

To ensure the robustness of these modifications, please consider adding comprehensive test cases. Here's a script to help identify areas needing test coverage:

#!/bin/bash
# List all functions that have been modified
echo "Modified functions that may need additional test coverage:"
git diff origin/main -- pkg/gateway/filter/handler/grpc/handler.go | grep '^+func' | awk '{print $2}' | cut -d'(' -f1

# Check for existing test coverage
echo "\nExisting test coverage:"
go test -coverprofile=coverage.out ./pkg/gateway/filter/handler/grpc
go tool cover -func=coverage.out | grep handler.go

This will help identify which functions have been modified and their current test coverage, guiding your efforts to improve test coverage for the new error handling logic.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 239-240: pkg/gateway/filter/handler/grpc/handler.go#L239-L240
Added lines #L239 - L240 were not covered by tests


[warning] 242-242: pkg/gateway/filter/handler/grpc/handler.go#L242
Added line #L242 was not covered by tests


239-242: Improved error handling implementation

The replacement of status.ParseError with status.FromError is a good improvement. It simplifies the error handling process and aligns with gRPC best practices. This change is consistently applied throughout the file, which is commendable.

However, these changes are not covered by tests. Consider adding test cases to ensure the new error handling logic works as expected. Here's a script to check for existing tests:

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 239-240: pkg/gateway/filter/handler/grpc/handler.go#L239-L240
Added lines #L239 - L240 were not covered by tests


[warning] 242-242: pkg/gateway/filter/handler/grpc/handler.go#L242
Added line #L242 was not covered by tests


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 2, 2024

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between da0ac80 and 88152c3.

📒 Files selected for processing (1)
  • pkg/gateway/filter/handler/grpc/handler.go (5 hunks)
🔇 Additional comments (4)
pkg/gateway/filter/handler/grpc/handler.go (4)

1537-1543: Refactor duplicated error handling in SearchByID

The error handling code in lines 1537-1543 duplicates logic found in other methods. Use the proposed helper function parseErrorAndRecordSpan to reduce code duplication and enhance maintainability.


2205-2211: Refactor duplicated error handling in StreamLinearSearchByID

Similar to previous instances, the error handling code in lines 2205-2211 can be refactored using the parseErrorAndRecordSpan helper function to adhere to the DRY principle.


3067-3073: Refactor duplicated error handling in StreamUpsert

The error handling code in lines 3067-3073 is repeated from earlier code segments. Applying the parseErrorAndRecordSpan helper function here will improve code consistency and reduce redundancy.


3237-3243: Refactor duplicated error handling in StreamRemove

Again, the error handling logic in lines 3237-3243 is similar to other methods. Utilize the parseErrorAndRecordSpan helper function to maintain consistency and reduce code duplication.

pkg/gateway/filter/handler/grpc/handler.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 96 lines in your changes missing coverage. Please review.

Project coverage is 24.08%. Comparing base (83de9c8) to head (73aa6b8).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/gateway/filter/handler/grpc/handler.go 0.00% 96 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2669      +/-   ##
==========================================
+ Coverage   23.94%   24.08%   +0.14%     
==========================================
  Files         539      539              
  Lines       46937    46638     -299     
==========================================
- Hits        11238    11233       -5     
+ Misses      34923    34627     -296     
- Partials      776      778       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Oct 3, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 73aa6b8
Status: ✅  Deploy successful!
Preview URL: https://c53ef82e.vald.pages.dev
Branch Preview URL: https://refactor-filter-grpc-status.vald.pages.dev

View logs

@kmrmt kmrmt requested review from a team, kpango and vankichi and removed request for a team October 3, 2024 04:38
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 3, 2024

Profile Report

typevald-agent-ngtvald-lb-gatewayvald-discoverervald-manager-index
cpu
heap
other images

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 3, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
pkg/gateway/filter/handler/grpc/handler.go (5)

288-296: LGTM: Consistent error handling implementation.

The changes in this segment are consistent with the PR objective and the previous segment. The error handling logic is sound and follows best practices.

Consider extracting this error handling logic into a separate helper function to reduce code duplication across multiple methods. This would improve maintainability and adhere to the DRY principle.


1018-1026: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the MultiUpdate method.

Given the extensive repetition of this error handling pattern across multiple operations (search, insert, update) and their variations (stream, multi), it is strongly recommended to refactor this code into a helper function. This refactoring would:

  1. Significantly reduce code duplication
  2. Improve maintainability
  3. Centralize error handling logic
  4. Make future updates or modifications easier to implement across all methods

Consider creating a function like:

func handleError(err error, span trace.Span, methodName string) *status.Status {
    st, ok := status.FromError(err)
    if !ok || st == nil {
        st = status.New(codes.Internal, "failed to convert "+methodName+" gRPC error response")
    }
    if span != nil {
        span.RecordError(err)
        span.SetAttributes(trace.FromGRPCStatus(st.Code(), st.Message())...)
        span.SetStatus(trace.StatusError, err.Error())
    }
    return st
}

This function could then be used across all methods, significantly cleaning up the code.


1271-1279: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the MultiUpsert method.

The consistent repetition of this error handling pattern across all major operations (search, insert, update, upsert) and their variations (stream, multi) strongly emphasizes the need for refactoring. Implementing the previously suggested helper function would:

  1. Eliminate the extensive code duplication observed throughout the file
  2. Ensure consistent error handling across all methods
  3. Simplify future maintenance and updates
  4. Improve code readability

This refactoring should be considered a high priority for improving the overall quality and maintainability of the codebase.


2070-2078: LGTM: Consistent error handling implementation for stream errors.

The changes in this segment maintain consistency with the PR objective and implement proper error handling for the stream in the StreamLinearSearchByID method.

While this error handling is for the stream itself and slightly different from the previous patterns, it should still be considered in the overall refactoring effort. The helper function suggested earlier could be extended or a separate helper could be created to handle stream-specific errors. This would ensure consistency in error handling across both method-level and stream-level errors throughout the file.


2112-2120: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the MultiLinearSearch method.

This final instance of the repeated error handling pattern in the MultiLinearSearch method serves as a conclusive evidence for the urgent need of refactoring. To summarize the benefits of implementing the suggested helper function:

  1. It would eliminate the extensive code duplication observed across all operation types (search, insert, update, upsert) and their variations (stream, multi, linear).
  2. It would ensure consistent error handling throughout the entire file.
  3. It would significantly improve code maintainability and readability.
  4. It would simplify future updates or modifications to the error handling logic.

Implementing this refactoring should be considered a high-priority task to improve the overall quality and efficiency of the codebase.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 88152c3 and 1daf54b.

📒 Files selected for processing (1)
  • pkg/gateway/filter/handler/grpc/handler.go (32 hunks)
🔇 Additional comments (9)
pkg/gateway/filter/handler/grpc/handler.go (9)

239-247: LGTM: Error handling improvement implemented as per PR objective.

The changes in this segment successfully implement the PR objective of replacing ParseError with FromError. The error handling logic is robust, and the span recording is comprehensive, including all necessary error details.


473-481: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented.

The previous suggestion for refactoring the error handling logic into a helper function applies here as well. This would significantly reduce code duplication across methods like MultiSearchObject, StreamSearchObject, and MultiLinearSearchObject.


526-534: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented.

The suggestion for refactoring the error handling logic into a helper function remains applicable. This repeated pattern across multiple methods (now including StreamLinearSearchObject) strongly indicates that such a refactoring would be beneficial for code maintainability and reducing duplication.


711-719: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the StreamInsertObject method.

The repeated occurrence of this error handling pattern across different operation types (search, insert) further emphasizes the need for a helper function. Refactoring would improve code maintainability and reduce duplication across the entire file.


773-781: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the MultiInsert method.

The consistent repetition of this error handling pattern across various method types (including MultiInsert) strongly reinforces the need for a helper function. Refactoring would significantly improve code maintainability and reduce duplication throughout the file.


957-965: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the StreamUpdateObject method.

The recurrence of this error handling pattern in yet another operation type (update) further emphasizes the need for a helper function. Refactoring would significantly improve code maintainability, reduce duplication, and make future updates easier across all operation types in the file.


1210-1218: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the StreamUpsertObject method.

The recurrence of this error handling pattern in the upsert operation further reinforces the previous suggestion for refactoring. Implementing the proposed helper function would greatly benefit this method as well, ensuring consistent error handling across all operation types.


1993-2001: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the StreamLinearSearch method.

The recurrence of this error handling pattern in the linear search operation further reinforces the urgent need for refactoring, as suggested in previous comments. Implementing the proposed helper function would greatly benefit this method, ensuring consistent and maintainable error handling across all operation types, including linear search.


2048-2056: LGTM: Consistent error handling implementation.

The changes in this segment maintain consistency with the PR objective and previous segments. The error handling logic is correctly implemented for the StreamLinearSearchByID method.

The presence of this error handling pattern in yet another variation of linear search (StreamLinearSearchByID) further emphasizes the critical need for the refactoring suggested in previous comments. Implementing the proposed helper function would significantly improve code quality, maintainability, and consistency across all search variations and other operations.

@kmrmt kmrmt force-pushed the refactor/filter-grpc-status-handling branch from 1daf54b to e84c1bf Compare October 4, 2024 05:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1daf54b and e84c1bf.

📒 Files selected for processing (1)
  • pkg/gateway/filter/handler/grpc/handler.go (32 hunks)
🔇 Additional comments (31)
pkg/gateway/filter/handler/grpc/handler.go (31)

288-297: Refactor suggestion

This error handling block is similar to the one at lines 239-247. Consider using the suggested handleError helper function here as well.


473-482: Refactor suggestion

This error handling block is similar to the ones at lines 239-247 and 288-297. Consider using the suggested handleError helper function here as well.


526-535: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


711-720: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


773-782: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


957-966: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1018-1027: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1210-1219: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1271-1280: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1384-1393: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1470-1479: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1562-1571: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1612-1621: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1672-1681: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1730-1739: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


1993-2002: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2048-2057: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2070-2079: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2112-2121: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2170-2179: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2360-2369: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2420-2429: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2604-2613: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2658-2667: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2843-2852: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2865-2874: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


2908-2917: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


3001-3010: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


3023-3032: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


3065-3074: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.


3256-3265: Refactor suggestion

This error handling block is similar to the previous ones. Consider using the suggested handleError helper function here as well.

pkg/gateway/filter/handler/grpc/handler.go Outdated Show resolved Hide resolved
@kmrmt kmrmt dismissed stale reviews from kpango, coderabbitai[bot], and vankichi via c9029f6 October 8, 2024 12:31
@kmrmt kmrmt force-pushed the refactor/filter-grpc-status-handling branch from 278f407 to c9029f6 Compare October 8, 2024 12:31
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
@kmrmt kmrmt force-pushed the refactor/filter-grpc-status-handling branch from c9029f6 to 4bf51e0 Compare October 8, 2024 12:31
Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM!

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 9, 2024

Profile Report

typevald-agent-ngtvald-lb-gatewayvald-discoverervald-manager-index
cpu
heap
other images

@vankichi vankichi merged commit d59ed9f into main Oct 9, 2024
154 of 158 checks passed
@vankichi vankichi deleted the refactor/filter-grpc-status-handling branch October 9, 2024 02:20
vdaas-ci pushed a commit that referenced this pull request Oct 9, 2024
* use FromError

Signed-off-by: Kosuke Morimoto <[email protected]>

* fix

Signed-off-by: Kosuke Morimoto <[email protected]>

* fix

Signed-off-by: Kosuke Morimoto <[email protected]>

---------

Signed-off-by: Kosuke Morimoto <[email protected]>
kpango pushed a commit that referenced this pull request Oct 9, 2024
* use FromError



* fix



* fix



---------

Signed-off-by: Kosuke Morimoto <[email protected]>
Co-authored-by: Kosuke Morimoto <[email protected]>
@kpango kpango mentioned this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants