Rust - Redis stage (#NA2) replication - Connection reset by peer (os error 104)

Repository link here

While working on Replication section 18, I keep failing the tests. I previously passed stage 17, but as a part of my solution to stage 18, it now fails. When I logged out the errors, I kept getting this error: Connection reset by peer (os error 104), which I found less than useful.

My changes are almost entirely in perform_await, which sends a REPLCONF GETACK * command to all replicas then reads the response. I have noticed that I do not get the error about resetting the connection if I don’t read the response from the replicas. That leads me to think that the error must be coming from how the test runner handles the streams. I have tested this locally, and, as far as I can tell, the behavior is identical to how Redis handles things (at least outwardly) for simple use cases.

I tested performed the following commands to test this (both against my own server and against the actual Redis server - i.e. replace cargo run with redis-server):

  1. cargo run in one terminal
  2. cargo run --port 6380 --replicaof 127.0.0.1 6379 in a second terminal
  3. cargo run --port 6381 --replicaof 127.0.0.1 6379 in a third terminal
  4. redis-cli set foo bar & redis-cli wait 5 1000 & wait in a fourth terminal
  5. redis-cli set bar baz && redis-cli wait 5 1000 in the same terminal as above

EDIT: The replica stream handling function might also be relevant.

Hey @benyakirten! Was trying this out and it looks like this is now resolved in your later commits (Please do correct me if I’m wrong)

Do you happen to recall what the issue was? Will be useful to anyone else who stumbles upon this.

Gonna mark this as solved for now, if you still need help please do let us know!

It seems this issue has popped up again since I last tried it. I also seem to have identical behavior to redis-server so it probably is an issue with the test stream.

@Hacker-007 I’d suggest opening a new thread with more details. Hard to debug without detailed information like in the first post on this thread

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

Note: I’ve updated the title of this post to include the stage ID (#NA2). You can learn about the stages rename here: Upcoming change: Stages overhaul