client.Client{} is throwing not able to send messages after the connection is broken and re-established
gufranmirza opened this issue · comments
Steps to reproduce:
- Start Redis server
docker run --name my-redis-container -p 6379:6379 -d redis
- Start the fluentbit instance
docker run -p 127.0.0.1:24224:24224/tcp -v `pwd`:`pwd` -w `pwd` \ -ti fluent/fluent-bit:1.8.2 /fluent-bit/bin/fluent-bit \ -c $(pwd)/fixtures/fluent.conf
- Produce the messages https://github.com/IBM/fluent-forward-go/tree/main/cmd/forward
- kill and restart the
fluentbit instance
- forward client will throw this error
write tcp 127.0.0.1:65418->127.0.0.1:24224: write: broken pipe
even if fluentbit instance is up
Expected behavior
- Client should automatically reconnect to the fluentbit instance once its again
@gufranmirza This isn't a bug. The peer closed the connection, hence the broken pipe. You'll need to call client.Disconnect
and then client.Connect
(Reconnect
isn't implemented yet, but feel free to PR ;) ).
If you're proposing automatic reconnects, then that's a feature request. However, I don't foresee implementing something like that in the near future.
@gufranmirza I'm closing this. If you'd like to suggest a feature, create a new issue. If you feel strongly that this is a bug, please re-open