platinasystems / go

Other
9 stars 68 forks source link

create new pub when redisd crashes #156

Closed atmecs123 closed 5 years ago

atmecs123 commented 5 years ago

Checked latest code for goes daemons restart,whenever redisd crashes/terminate process new process is created with goes-daemons as parent pid.But counters do not get updated into redis. I added the code for creating new publisher that will start publishing to pub channel after redisd daemon is restarted. siddhant@invader47:~/golang/src/github.com/platinasystems/goes-platina-mk1$ ping 10.0.26.25 PING 10.0.26.25 (10.0.26.25) 56(84) bytes of data. 64 bytes from 10.0.26.25: icmp_seq=44 ttl=64 time=0.191 ms 64 bytes from 10.0.26.25: icmp_seq=45 ttl=64 time=0.169 ms 64 bytes from 10.0.26.25: icmp_seq=46 ttl=64 time=0.136 ms 64 bytes from 10.0.26.25: icmp_seq=47 ttl=64 time=0.179 ms 64 bytes from 10.0.26.25: icmp_seq=48 ttl=64 time=0.126 ms ^C --- 10.0.26.25 ping statistics --- After adding new publisher, siddhant@invader25:~$ sudo goes hgetall platina-mk1 | grep xeth26 | grep rx-packets vnet.xeth26.rx-packets: 5

Counters incrementing into redis.

tgrennan commented 5 years ago

This is the wrong approach. vnetd and others should detect when the @redis.pub closes and start a goroutine to continue open retry.