* we refuse to enqueue new requests until
* one or more connections comes online.
*/
- if (trunk->last_failed && (trunk->last_failed >= trunk->last_connected)) {
+ if (!trunk->conf.backlog_on_failed_conn &&
+ trunk->last_failed && (trunk->last_failed >= trunk->last_connected)) {
ROPTIONAL(RWARN, WARN, "Refusing to enqueue requests - "
"No active connections and last event was a connection failure");
///< If this is true, #fr_trunk_connection_signal_writable
///< does not need to be called, and requests will be
///< enqueued as soon as they're received.
+
+ bool backlog_on_failed_conn; //!< Assign requests to the backlog when there are no
+ //!< available connections and the last connection event
+ //!< was a failure, instead of failing them immediately.
} fr_trunk_conf_t;
/** Public fields for the trunk request
TEST_CHECK(fr_connection_get_num_reconnected(tconn->pub.conn) == 1);
events = fr_event_corral(el, test_time_base, true);
- TEST_CHECK(events == 2); /* Should have a pending I/O event and a timer */
+ TEST_CHECK(events == 1); /* Should have a pending I/O event and a timer */
talloc_free(trunk);
talloc_free(ctx);
.manage_interval = NSEC * 0.5,
.conn_conf = &(fr_connection_conf_t){
.reconnection_delay = NSEC * 0.1
- }
+ },
+ .backlog_on_failed_conn = true
};
test_proto_request_t *preq;
fr_trunk_request_t *treq = NULL;