Skip to content

feat: differentiate between complete and close event types #1158

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

Conversation

endigma
Copy link
Member

@endigma endigma commented May 23, 2025

Adds differentiation between Complete/Done and Close/Shutdown events, so that downstream subgraph closure may be communicated more effectively to the upstream client.

@endigma endigma marked this pull request as draft May 23, 2025 11:44
@endigma endigma changed the title feat: communicate downstream errors more effectively feat: differentiate between complete and close event types May 23, 2025
@endigma endigma force-pushed the jesse/eng-7047-subscription-communicate-downstream-errors branch 2 times, most recently from 3abc2ee to 375cfdf Compare May 28, 2025 18:04
@endigma endigma marked this pull request as ready for review May 28, 2025 18:04
@endigma endigma requested review from devsergiy, StarpTech and Noroth May 28, 2025 18:16
@endigma endigma force-pushed the jesse/eng-7047-subscription-communicate-downstream-errors branch from 375cfdf to 6f484cc Compare May 30, 2025 07:58
@endigma endigma requested a review from devsergiy May 30, 2025 08:02
@endigma endigma force-pushed the jesse/eng-7047-subscription-communicate-downstream-errors branch from a5a1824 to 37feffd Compare June 2, 2025 08:33
Copy link
Collaborator

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

@endigma endigma force-pushed the jesse/eng-7047-subscription-communicate-downstream-errors branch from ada5085 to 41684c9 Compare June 4, 2025 08:04
@endigma endigma merged commit 79f3f41 into master Jun 4, 2025
9 checks passed
@endigma endigma deleted the jesse/eng-7047-subscription-communicate-downstream-errors branch June 4, 2025 10:13
endigma pushed a commit that referenced this pull request Jun 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.0.0-rc.185](v2.0.0-rc.184...v2.0.0-rc.185)
(2025-06-04)


### Features

* differentiate between complete and close event types
([#1158](#1158))
([79f3f41](79f3f41))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
devsergiy pushed a commit that referenced this pull request Jun 5, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](execution/v1.2.0...execution/v1.3.0)
(2025-06-05)


### Features

* add apollo router compat flag for invalid variable rendering
([#1067](#1067))
([e87961f](e87961f))
* add deprecated arguments support to introspection
([#1142](#1142))
([1ac2908](1ac2908))
* apollo-router-like non-ok http status errors
([#1072](#1072))
([e685c29](e685c29))
* differentiate between complete and close event types
([#1158](#1158))
([79f3f41](79f3f41))
* **engine:** mutex free subscription handling
([#1076](#1076))
([21be4ab](21be4ab))
* implement gRPC datasource
([#1146](#1146))
([146a552](146a552))
* update engine version for execution pkg
([#1171](#1171))
([9769beb](9769beb))


### Bug Fixes

* fix printing object value with optional fields
([#1065](#1065))
([5730d72](5730d72))
* handle scalar values for lists
([#1155](#1155))
([94031e5](94031e5))
* interface objects
([#1055](#1055))
([858d929](858d929))
* print indent once per level by default
([#1147](#1147))
([0f022e5](0f022e5)),
closes
[#405](#405)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
endigma added a commit that referenced this pull request Jun 10, 2025
…aviour (#1174)

In #1158, I added a new path for handling server closure, but as an
unintended side effect some scenarios that were previously silently
failing such as complete-after-error in subscription init events became
obviously broken.

This PR follows up on this by adding options for the _kind_ of closure
the caller wants, including 3 to start:

- "normal" = the connection is being closed normally and intentionally,
such as in the case of connection failure
- "downstream service error" = the subgraph closes the connection before
completing
- "going away" = used during router shutdown to indicate the router
itself is shutting down

It also:
- renames many instances of "Shutdown" to "Close" and "Done" to
"Complete" for consistent terminology through the router and engine for
subscriptions.
- corrects behaviour where we were not distinguishing between removing
clients for different reasons and always sending complete as if it was
because the client sent complete, now handles complete separately
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.

5 participants