#include <opensrf/transport_connection.h>
+#include<unistd.h>
transport_con* transport_con_new(const char* domain) {
osrfLogError(OSRF_LOG_MARK, "REDIS Error [%s] %s", err, VA_BUF);
freeReplyObject(reply);
+ // Some bus error conditions can lead to looping on an unusable
+ // connection. Avoid flooding the logs by inserting a short
+ // wait after any Redis errors. Note, these should never happen
+ // under normal wear and tear. It's possible we should just exit
+ // here, but need to collect some data first.
+ osrfLogError(OSRF_LOG_MARK, "Resting for a few seconds after bus failure...");
+ sleep(3);
+
return 1;
}
eval { $self->redis->rpush($dest_stream, $msg_json) };
- if ($@) { $logger->error("RPUSH error: $@"); }
+ if ($@) {
+ $logger->error("RPUSH error: $@");
+ $logger->error("BusConnection pausing for a few seconds after bus error");
+ sleep(3);
+ }
}
# $timeout=0 means check for data without blocking