mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
socket-util: Rate limit logs for bind attempts.
This reduces the amount of logging when higher-level code retries binding ports that are in use. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
This commit is contained in:
@@ -725,7 +725,8 @@ inet_open_passive(int style, const char *target, int default_port,
|
||||
/* Bind. */
|
||||
if (bind(fd, (struct sockaddr *) &ss, ss_length(&ss)) < 0) {
|
||||
error = sock_errno();
|
||||
VLOG_ERR("%s: bind: %s", target, sock_strerror(error));
|
||||
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
||||
VLOG_ERR_RL(&rl, "%s: bind: %s", target, sock_strerror(error));
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user