Unverified Commit 7b435001 authored by Niklas Adolfsson's avatar Niklas Adolfsson Committed by GitHub
Browse files

fix(server): remove `MethodSinkPermit` to fix backpressure issue on concurrent...


fix(server): remove `MethodSinkPermit` to fix backpressure issue on concurrent subscriptions (#1126)

* fix(server): don't use `Permit` for responses

After a method call has been received, this PR doesn't keep the `Permit`
anymore and requires each response to await for a slot in the mpsc buffer.

This is especially important for subscriptions which previously
two slots were unintentionally required because the server kept one around until
the subscription was "accepted" and the subscription itself waited for a slot.

If many concurrent subscriptions were received "concurrently" and "filled" the buffer
no subscription could make progress.

* cleanup code

* Update server/src/transport/ws.rs

Co-authored-by: default avatarJames Wilson <[email protected]>

* Update core/src/server/helpers.rs

Co-authored-by: default avatarJames Wilson <[email protected]>

* cargo fmt

---------

Co-authored-by: default avatarJames Wilson <[email protected]>
parent 2b3bb143
Pipeline #281608 passed with stages
in 1 hour, 10 minutes, and 7 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment