Skip to content
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

RedisBroadcastService getting stuck with errors, in case of connection interruption to Redis cluster #5233

Open
tamcore opened this issue Dec 11, 2023 · 1 comment

Comments

@tamcore
Copy link

tamcore commented Dec 11, 2023

Describe the bug
If the connection between Traccar and the Redis cluster dies for any reason, the connection is not automatically reestablished and logs are spammed with logs like

2023-12-11 14:39:40  WARN: Broadcast failed -
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe (Write failed)
at redis.clients.jedis.Connection.flush(Connection.java:341)
at redis.clients.jedis.Connection.getIntegerReply(Connection.java:292)
at redis.clients.jedis.Jedis.publish(Jedis.java:7937)
at org.traccar.broadcast.RedisBroadcastService.sendMessage(RedisBroadcastService.java:71)

To Reproduce

  1. Configure traccar with broadcast.type redis
  2. Point broadcast.address against a redis instance with a configured timeout (or just manually interrupt the connection, once everything is up and running)
  3. Monitor Redis client list with redis-cli -h 1.2.3.4 client list | grep jedis until all clients are gone
  4. Send data to traccar instance
  5. => Receive errors in logs

Expected behavior
Have traccar reestablish the lost connection to Redis and resend the failed broadcast message.

Additional context
Running version v5.10 in Kubernetes with multiple traccar replicas pointing against a redis-cluster behind haproxy.

@tananaev
Copy link
Member

Yeah, currently the implementation is pretty basic. We can probably use JedisPool to manage connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants