mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
Revert "BUG/MINOR: server: shut down streams under thread isolation"
This reverts commit b500e84e24fd19ccbcdf4fae5165aeb07e46bd67. Thread isolation does not work well for this, there exists code paths which already hold the server's lock and result in a deadlock. Let's revert that and address it better without isolation.
This commit is contained in:
parent
0c94b2efec
commit
d1c398b786
@ -2015,9 +2015,7 @@ static int srv_has_streams(struct server *srv)
|
||||
* code in <why>, which must be one of SF_ERR_* indicating the reason for the
|
||||
* shutdown.
|
||||
*
|
||||
* Note: the function will switch to thread isolation (due to shutdown_stream()
|
||||
* modifying the streams directly), and commonly called with the server's lock
|
||||
* held as well though not needed anymore (this is not a bug).
|
||||
* Must be called with the server lock held.
|
||||
*/
|
||||
void srv_shutdown_streams(struct server *srv, int why)
|
||||
{
|
||||
@ -2025,14 +2023,10 @@ void srv_shutdown_streams(struct server *srv, int why)
|
||||
struct mt_list back;
|
||||
int thr;
|
||||
|
||||
thread_isolate();
|
||||
|
||||
for (thr = 0; thr < global.nbthread; thr++)
|
||||
MT_LIST_FOR_EACH_ENTRY_LOCKED(stream, &srv->per_thr[thr].streams, by_srv, back)
|
||||
if (stream->srv_conn == srv)
|
||||
stream_shutdown(stream, why);
|
||||
|
||||
thread_release();
|
||||
}
|
||||
|
||||
/* Shutdown all connections of all backup servers of a proxy. The caller must
|
||||
|
Loading…
x
Reference in New Issue
Block a user