Skip to content

Commit 53d1062

Browse files
committed
fix infinite loop on connection failures
ngx_http_upsync_connect_handler(): When ngx_event_connect_peer() fails, we shouldn't set the current timer timeout to 0 as that immediatelly calls the current function again. Instead, we should call ngx_http_upsync_clean_event() to properly clean up & to set the reconnection timer.
1 parent 579bc8f commit 53d1062

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ngx_http_upsync_module.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,9 +2643,7 @@ ngx_http_upsync_connect_handler(ngx_event_t *event)
26432643
"upsync_connect_handler: cannot connect to upsync_server: %V ",
26442644
upsync_server->pc.name);
26452645

2646-
ngx_del_timer(&upsync_server->upsync_timeout_ev);
2647-
ngx_add_timer(&upsync_server->upsync_ev, 0);
2648-
2646+
ngx_http_upsync_clean_event(upsync_server);
26492647
return;
26502648
}
26512649

0 commit comments

Comments
 (0)