-
Notifications
You must be signed in to change notification settings - Fork 173
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
Deadlock when request is issued when some subscription is active #143
Comments
Right, so the simple fix is to use an unbounded channel? It seems tricky to pick the "right" buffer size. |
IMHO have it user-configured and drop excessive notifications (they usually have an ephemeral nature anyway). If the user is interested in not missing any of them, then they can set the size of the channel high enough. We can't (and imho shouldn't) really back-pressure the server, it would presumably be dropping excessive notifications if the client can't keep up either (or even dropping the connection) - you can't stop the external stuff that generates these notifications from making progress really :) |
Fixed by #180 |
Steps to repeat:
grandpa_justifications
);jsonrpsee::Subscription
;chain_getHeader
) using the same client => deadlock.The reason is that notifications channel is created with buffer size = 4. When we're trying to send 5th notification using blocking
SinkExt::send().await
here, the background thread will stop processingFrontToBack
requests. So if we have single-threaded client, it'll block here, waiting for background thread to issue request and read response. At the same time, background thread is waiting for us to read pending notifications from the channel.The text was updated successfully, but these errors were encountered: