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

Grapesy server kills client with "too many pings" / "too many empty data" #177

Closed
edsko opened this issue Jul 2, 2024 · 7 comments
Closed
Labels
bug Something isn't working priority: high Usability of the library severely hindered

Comments

@edsko
Copy link
Collaborator

edsko commented Jul 2, 2024

Two manifestations:

  • When running with a larger window size and more workers, the Java client gets killed by the grapesy server ("too many pings"). Related: Make ping rate limit configurable kazu-yamamoto/http2#108 .
  • Grapesy kvstore (without JSON) against itself, with 16 MB of connection space, crashes with "too many empty data"
@edsko edsko added bug Something isn't working priority: high Usability of the library severely hindered labels Jul 2, 2024
@edsko edsko changed the title Grapesy server kills Java client with "too many pings" Grapesy server kills client with "too many pings" / "too many empty data" Jul 2, 2024
@edsko
Copy link
Collaborator Author

edsko commented Jul 9, 2024

Suggestions:

  • We should up the ping limit again (the Java client sends a lot of pings)
  • Maybe to reproduce the "too many empty", we could lower the limit (hardcoded in http2 currently) and try again; and if we have a better understanding (or maybe even without), we should submit a patch to http2 to make the limit configurable and raise the default (maybe we should just make all limits configurable).

@FinleyMcIlwaine
Copy link
Collaborator

I am now seeing the too many empty data in the kvstore benchmark ran with

cabal run grapesy-kvstore -- --benchmark --no-work-simulation

At commit 700138262da29573f45a8344205ee36c50cc0b71 (on edsko/new-http2-architecture). It appears to be somewhat non-deterministic, as slowing things down with some intermediate checks/tracing makes it less likely.

What I have determined so far is that the server is sending empty data frames to the client.

@FinleyMcIlwaine
Copy link
Collaborator

I believe this can be closed now, fixed by #183

@edsko edsko closed this as completed Jul 17, 2024
@edsko
Copy link
Collaborator Author

edsko commented Aug 1, 2024

Reopening, we're seeing "too many empty data" again.

@edsko edsko reopened this Aug 1, 2024
@edsko
Copy link
Collaborator Author

edsko commented Aug 1, 2024

Note: we previously thought we should in principle be able to set the limit for empty DATA to zero; this is not the case: this would only be possible for clients and server handlers who know when they send their final message that it is in fact the final message; this is not always true. It also also not true for clients they terminate with an exception, which will result in stream being closed with an empty DATA frame (see also #209).

@FinleyMcIlwaine
Copy link
Collaborator

I have the reproducer on the finley/177 branch. If you run

cabal run test-grapesy -- -p '/Test.Sanity.Exception/'

You will see the empty data exceptions being printed from handleException.

@edsko
Copy link
Collaborator Author

edsko commented Aug 1, 2024

I think we realized what was happening here. The test in Test.Sanity.Exception starts 100 concurrent calls. As written, due to #209, the server handler that was unlucky enough to deal with the client that throws an exception, would itself terminate with HandlerTerminated. Since this is not an "expected exception" in the test suite, all other still ongoing tests would then be killed, resulting in the empty data frames.

@edsko edsko closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high Usability of the library severely hindered
Projects
None yet
Development

No branches or pull requests

2 participants