mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MEDIUM: peers: make "show peers" more careful about partial initialization
Since 2.6 with commit 34e4085f8 ("MEDIUM: peers: Balance applets across threads") the initialization of a peers appctx may be postponed with a wakeup, causing some partially initialized appctx to be visible. The "show peers" command used to only care about peers without appctx, but now it must also take care of those with no stconn, otherwise it can occasionally crash while dumping them. This fix must be backported to 2.6. Thanks to Patrick Hemmer for reporting the problem.
This commit is contained in:
parent
6be8d09a61
commit
03926129b0
@ -3898,6 +3898,14 @@ static int peers_dump_peer(struct buffer *msg, struct appctx *appctx, struct pee
|
||||
peer->appctx->t ? peer->appctx->t->calls : 0);
|
||||
|
||||
peer_cs = appctx_sc(peer->appctx);
|
||||
if (!peer_cs) {
|
||||
/* the appctx might exist but not yet be initialized due to
|
||||
* deferred initialization used to balance applets across
|
||||
* threads.
|
||||
*/
|
||||
goto table_info;
|
||||
}
|
||||
|
||||
peer_s = __sc_strm(peer_cs);
|
||||
|
||||
chunk_appendf(&trash, " state=%s", sc_state_str(sc_opposite(peer_cs)->state));
|
||||
|
Loading…
x
Reference in New Issue
Block a user