Skip to content

Improve error handling for coprocessor responses #7607

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

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Jun 4, 2025

When a coprocessor returns some invalid data, you now get an HTTP 500 with extension code "EXTERNAL_CALL_ERROR" instead of "INTERNAL_SERVER_ERROR", and a slightly improved error message that mentions the coprocessor.

Additionally removes some potential for errors by not deserializing the SDL and the query plan from a coprocessor response.

Todos

  • A changeset
  • Update the docs to discourage responding with read-only keys like "queryPlan" and "sdl"

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
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • 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. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

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

They are read-only and can't be modified by a coprocessor. Deserializing
them wastes work and can cause problems if a coprocessor returns invalid
data. This can happen for the query plan, because its shape is unstable
and a coprocessor may accidentally rely on an old shape.
Copy link
Contributor

github-actions bot commented Jun 4, 2025

@goto-bus-stop, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Jun 4, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 75d7691ec6baa0342bdf91ed

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