CLEANUP: connection: open-code conn_cond_update_polling() and update the comment
This last call to conn_cond_update_polling() is now totally misleading as
the function only stops polling in case of unrecoverable connection error.
Let's open-code the test to make it more prominent and explain what we're
trying to do there. It's even almost certain this code is never executed
anymore, as the only remaining case should be a mux's wake function setting
CO_FL_ERROR without disabling the polling, but they need to be audited first
to make sure this is the case.
diff --git a/src/connection.c b/src/connection.c
index 13c9930..155e561 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -177,9 +177,16 @@
conn->mux && conn->mux->wake && conn->mux->wake(conn) < 0)
return;
- /* commit polling changes */
- conn_cond_update_polling(conn);
- return;
+ /* commit polling changes in case of error.
+ * WT: it seems that the last case where this could still be relevant
+ * is if a mux wake function above report a connection error but does
+ * not stop polling. Shouldn't we enforce this into the mux instead of
+ * having to deal with this ?
+ */
+ if (unlikely(conn->flags & CO_FL_ERROR)) {
+ if (conn_ctrl_ready(conn))
+ fd_stop_both(fd);
+ }
}
/* This is the callback which is set when a connection establishment is pending