-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Distribute back pressure evenly in notification protocols. #8410
Conversation
This should fix the bug that streams won't get flushed on a timely manner.
|
What exactly is the problem that you're observing and that you're trying to fix? |
Flushing of data seems to be delayed quite a lot (seconds) in Polkadot. Looking at the code, the current triggering of flushing looks imperfect as a call to We still need to test on rococo, whether this actually fixes the issue. |
Also see #8405 for an earlier (and flawed) approach. |
This can only happen if all cores are 100% busy and the task is never scheduled. Is that what we observe? The code is far from being perfect, but I don't think it's a good idea to add weird-looking code if we're not sure that it solves a problem. |
If |
|
It is no different than a regular future: If |
|
@tomaka there is some similar bug with flushing as you fixed in November on some upper layer? As in November we see that a notification is written, but sometimes it takes 3-6 seconds to reach the other end. The size of the notification is only 160 bytes, so that should not be related to taking too being to slow to transfer. |
|
Edit: I'm dumb. I know that you are on vacation, could you give us a hint on what needs to be done for a Proper fix? |
|
I don't know what to fix since I don't know what the bug is. The code looks functional to me as it is in master. Not great in quality, but also not buggy. |
|
Still, if the initial fix of calling
The previous fix would only work, if we were like completely idle, but a simple ready input stream would ruin it. This PR is meant to fix this. What am I missing? |
|
Ok, after a good night sleep, it is rather obvious: We are not worried about getting called in a timely manner when we return |
|
Closing in favour of #8422 |
This should fix the bug that streams won't get flushed on a timely
manner in Polkadot.