ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.26k stars 746 forks source link

Fusion with only SSE subscriptions fail if message is too large #6739

Closed molinch closed 11 months ago

molinch commented 12 months ago

Is there an existing issue for this?

Product

Hot Chocolate

Describe the bug

With version 13.4.0 GraphQL SSE subgraph support was added to fusion. (https://github.com/ChilliCream/graphql-platform/pull/6356)

It seems that when SSE messages are bigger than X bytes, then exceptions occur on the gateway, which results in those messages being dropped.

The issue is with GraphQLHttpEventStreamProcessor, see: image

The following exception gets thrown: image

Steps to reproduce

  1. Have a subgraph which offers a subscription via SSE
  2. Have a gateway that fusions subgraphs and offers the same subscription via SSE
  3. Use BCP of the gateway to subscribe and receive the messages
  4. It will throw

If you use BCP directly on the downstream service (subgraph), then it works fine

Relevant log output

No response

Additional Context?

No response

Version

13.7.1-preview.2

glen-84 commented 12 months ago

I don't know if it's related, but there was a fix here that is in the 14.x previews.

molinch commented 12 months ago

I confirm that 14 fixes the issue.

I used 13.7.1-preview.2 and forced to use latest HotChocolate.Transport.Http with it: <PackageReference Include="HotChocolate.Transport.Http" VersionOverride="14.0.0-p.15" /> Lucikily it seems to be compatible.

Then it works as a charm. Could the fix be backported to 13? Otherwise SSE is unusable.

michaelstaib commented 12 months ago

We will port this back... just did not have the time yet.

glen-84 commented 11 months ago

Should be fixed in 13.8.0-preview.3.