BUG/MEDIUM: check/threads: do not involve the rendez-vous point for status updates
thread_isolate() is currently being called with the server lock held.
This is not acceptable because it prevents other threads from reaching
the rendez-vous point. Now that the LB algos are thread-safe, let's get
rid of this call.
No backport is nedeed.
diff --git a/src/server.c b/src/server.c
index b73cc2e..78d5a0f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -962,9 +962,7 @@
}
/* propagate changes */
- thread_isolate();
srv_update_status(s);
- thread_release();
for (srv = s->trackers; srv; srv = srv->tracknext) {
HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
@@ -1009,9 +1007,7 @@
s->next_state = SRV_ST_RUNNING;
/* propagate changes */
- thread_isolate();
srv_update_status(s);
- thread_release();
for (srv = s->trackers; srv; srv = srv->tracknext) {
HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
@@ -1055,9 +1051,7 @@
}
/* propagate changes */
- thread_isolate();
srv_update_status(s);
- thread_release();
for (srv = s->trackers; srv; srv = srv->tracknext) {
HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
@@ -1092,9 +1086,7 @@
strlcpy2(s->adm_st_chg_cause, cause, sizeof(s->adm_st_chg_cause));
/* propagate changes */
- thread_isolate();
srv_update_status(s);
- thread_release();
/* stop going down if the equivalent flag was already present (forced or inherited) */
if (((mode & SRV_ADMF_MAINT) && (s->next_admin & ~mode & SRV_ADMF_MAINT)) ||
@@ -1136,9 +1128,7 @@
s->next_admin &= ~mode;
/* propagate changes */
- thread_isolate();
srv_update_status(s);
- thread_release();
/* stop going down if the equivalent flag is still present (forced or inherited) */
if (((mode & SRV_ADMF_MAINT) && (s->next_admin & SRV_ADMF_MAINT)) ||
@@ -1266,11 +1256,8 @@
sv->next_eweight = (sv->uweight * w + px->lbprm.wmult - 1) / px->lbprm.wmult;
/* propagate changes only if needed (i.e. not recursively) */
- if (must_update) {
- thread_isolate();
+ if (must_update)
srv_update_status(sv);
- thread_release();
- }
}
/*