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
Messages dropped silently when using SinkWrite #431
Comments
I have updated the message above with an example reproducing the issue. |
Investigated a bit more. Repeating the block:
In the example leads to two polls for every three messages subsequently. One poll in the first 3 messages. Also, adding:
To the actor context makes it poll the SinkWrite and works around the issue. The issue appears to be with the
Seems to work around this issue by processing several messages in one |
Any new info on this? Did you find the underlying issue? |
The source of the problem should be |
I found the mentioned code and I'm pasting a link to it here. Could you guide me through the changes needed as I'd like to work on this issue for hacktoberfest? |
@elpiel I haven't looked at it much in dept, but maybe a solution could be to call |
Sorry I have notification disabled.I personally would prefer to use tokio codec directly instead of a homebrew frame. That said a fix to current code is great too as it's much less work for the same purpose. |
Any update here? i'm constantly hitting this via fn poll_ready(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
if self.is_write_buf_full() {
self.flush()
} else {
Poll::Pending
}
} If this is truly all that is needed i can throw together the PR as its a bit time sensitive for us. |
if you want to give it a crack then feel free, this is not currently at top of priority list |
@brockelmore You need to register the waker when returning fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
if self.is_write_ready() {
Poll::Ready(Ok(()))
} else {
self.flush(cx)
}
} |
actix-codec 0.4.1 is released with this fixed, should just be a cargo update to get it |
Expected Behavior
When 3 messages are written into SinkWrite, they should all be processed. Possibly related to: #384. Could also be somewhere in
awc
.Current Behavior
The third message is not processed.
Steps to Reproduce (for bugs)
Example:
Opened a server with
wscat -l 7878
and output of the example is:However the server only sees:
In my real life example the third message is the first one missing.
Context
Messages dropped silently. Using in conjunction with
awc::ws
Your Environment
Arch Linux: 5.8.3-arch1-1
Also reproducing on Ubuntu 20.04
rustc -V
):rustc 1.45.2 (d3fb005a3 2020-07-31)
0.10
awc 2.0.0
I am currently investigating the issue, but I would appreciate if anybody has an idea on where the problem could be.
The text was updated successfully, but these errors were encountered: