--- /dev/null
+ o Minor features (logging, scheduler):
+ - Introduce a SCHED_BUG() function to log extra information about the
+ scheduler state if we ever catch a bug in the scheduler. Closes ticket
+ 23753.
}
if (chan->scheduler_state == SCHED_CHAN_PENDING) {
- if (smartlist_pos(channels_pending, chan) == -1) {
+ if (SCHED_BUG(smartlist_pos(channels_pending, chan) == -1, chan)) {
log_warn(LD_SCHED, "Scheduler asked to release channel %" PRIu64 " "
"but it wasn't in channels_pending",
chan->global_identifier);
/* In theory, this can not happen because we can not scheduler a channel
* without a connection that has its outbuf initialized. Just in case, bug
* on this so we can understand a bit more why it happened. */
- if (BUG(BASE_CHAN_TO_TLS(chan)->conn == NULL)) {
+ if (SCHED_BUG(BASE_CHAN_TO_TLS(chan)->conn == NULL, chan)) {
return 0;
}
return buf_datalen(TO_CONN(BASE_CHAN_TO_TLS(chan)->conn)->outbuf);
{
socket_table_ent_t *ent = NULL;
ent = socket_table_search(table, chan);
- IF_BUG_ONCE(!ent) {
+ if (SCHED_BUG(!ent, chan)) {
return 1; // Just return true, saying that kist wouldn't limit the socket
}
{
socket_table_ent_t *ent = NULL;
ent = socket_table_search(table, chan);
- IF_BUG_ONCE(!ent) {
+ if (SCHED_BUG(!ent, chan)) {
return; // Whelp. Entry didn't exist for some reason so nothing to do.
}
update_socket_info_impl(ent);
{
socket_table_ent_t *ent = NULL;
ent = socket_table_search(table, chan);
- IF_BUG_ONCE(!ent) {
+ if (SCHED_BUG(!ent, chan)) {
return; // Whelp. Entry didn't exist so nothing to do.
}