2

I'm seeing the following error on running the Wait() command in go-redis in a private repo:

read tcp xxx.xxx.xxx.x:xxx1-> xxx.xxx.xxx.x:xxx9: i/o timeout

Surprisingly, I use LPUSH, HSET commands in the same function which pass but as soon as I want to do a WAIT, the service errors out. The service connects to redis fine and I have verified the LPUSH and HSET inputs in the db and the transactions went through successfully.

Is there any reason why only the WAIT command would error out in this? The function call looks like: service.redis.Wait(1, time.Second*5)

  • Were you able to verify that the results of LPUSH and HSET were also propagated to the replica within 5 sec? – phonaputer Dec 22 '21 at 03:35
  • Yes, the values were added to the db. – Akshat Raika Dec 22 '21 at 14:56
  • They are in the DB on master only, or on both master & replica? The WAIT command is waiting from them to be on both replica & master before returning a response. In your case, since it is `Wait(1,` it is waiting for the values to be on master and also 1 replica. – phonaputer Dec 23 '21 at 01:31
  • I see, only in master. I changed it to 0 but the error still persists. – Akshat Raika Dec 27 '21 at 16:44
  • It sounds like maybe there's a problem with replication between the master and replica(s). By the way, according to [the docs](https://redis.io/commands/wait) "A timeout of 0 means to block forever." So that would explain the timeout in that case. – phonaputer Dec 29 '21 at 01:33

0 Answers0