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(subgraph_service): when the subgraph connection is closed or in error, return a proper subgraph response #5859

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Aug 21, 2024

When the subgraph connection is closed or in error, return a proper subgraph response containing an error. This was preventing subgraph response service to be triggered in coprocessor and rhai.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

… error when calling the subgraph, return proper subgraph response

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj requested review from a team as code owners August 21, 2024 08:54
@bnjjj bnjjj self-assigned this Aug 21, 2024
@bnjjj bnjjj added the bug label Aug 21, 2024

This comment has been minimized.

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj requested a review from a team as a code owner August 21, 2024 08:56
Copy link
Contributor

@Geal Geal left a comment

Choose a reason for hiding this comment

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

this looks ok, but I wonder if we should instead have a wrapper in Service::call to convert Err to a subgraph response every time, to make sure we won't see that issue again. Or maybe make sure that call_single_http and others do not return a Result but a graphql response

@bnjjj
Copy link
Contributor Author

bnjjj commented Aug 21, 2024

@Geal IMHO there is still bad things that can happen and should still appear in map_err, here the situation is different because it's directly related to the subgraph call. But we could have a critical internal error that should be treated as a real error and so IMHO we should keep Result anywhere else.

@Geal
Copy link
Contributor

Geal commented Aug 21, 2024

yup. as long as everything that gets out of the subgraph service is a graphql response, it will be fine

@bnjjj bnjjj merged commit cdf9e6b into dev Aug 21, 2024
13 checks passed
@bnjjj bnjjj deleted the bnjjj/fix_fatal_error_subgraph_resposne branch August 21, 2024 09:52
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

Looks good.

@abernix abernix mentioned this pull request Aug 28, 2024
bnjjj added a commit that referenced this pull request Sep 26, 2024
…rror, return a proper subgraph response (#5859)

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
bnjjj added a commit that referenced this pull request Sep 26, 2024
…rror, return a proper subgraph response (#5859)

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
abernix added a commit that referenced this pull request Sep 26, 2024
…rror, return a proper subgraph response (#5859) (#6065)

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Jesse Rosenberger <git@jro.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants