Welcome! Log In Create A New Profile

Advanced

Re: UDP Connection refused

Maxim Dounin
March 12, 2020 08:36AM
Hello!

On Thu, Mar 12, 2020 at 02:32:23AM -0400, inkognito0609 wrote:

> При отправке логов через syslog (udp) проскакивают ошибки 111 Connection
> refused, что непонятно при отправке логов по udp, так как этот протокол не
> подразумевает установки соединения в принципе.
>
> strace дает следующее:
> 30752 sendto(64, "<190>Mar 12 09:45:59 balancer nginx: { \"timestamp\":
> \"2020-03-12T09:45:59+05:00\", \"remote_addr\": \"91.144.134.5\",
> \"body_bytes_sent\": 18686, \"request_time\": 0.000, \"response_status\":
> 200, \"request\": \"GET /themes/default/images/flags.png HTTP/1.0\",
> \"request_method\": \"GET\", \"host\":
> \"chel.wifi.example.ru\",\"upstream_cache_status\":
> \"HIT\",\"upstream_addr\": \"\",\"http_x_forwarded_for\":
> \"10.12.199.134\",\"http_referrer\":
> \"https://chel.wifi.domru.ru/index.php?request_uri=http://captive.apple.com/hotspot-detect.html\",
> \"upstream_response_time\": \"\",\"upstream_header_time\":
> \"\",\"upstream_connect_time\": \"\",\"http_user_agent\": \"Mozilla/5.0
> (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like
> Gecko)\",\"x-project\": \"\",\"cluster\": \"1\",\"container_id\":
> \"\",\"citydomain\": \"\" }", 765, 0, NULL, 0) = -1 ECONNREFUSED (Connection
> refused)

Да, так бывает.

Цитируя "Programming UNIX Sockets in C - Frequently Asked
Questions", AKA Socket FAQ
(http://web.deu.edu.tr/doc/soket/#faq57):

: If the target machine discards the message because there is no
: process reading on the requested port number, it sends an ICMP
: message to your machine which will cause the next system call on
: the socket to return ECONNREFUSED. Since delivery of ICMP messages
: is not guarenteed you may not recieve this notification on the
: first transaction.

То есть ошибка ожидаема, и она означает, что на предыдущее
сообщение в syslog прилетело ICMP-сообщение в ответ.

Если вы не в курсе, что у вас часть UDP-сообщений где-то
реджектится - это повод разобраться, где и почему. Если в курсе -
это лишнее напоминание, что оно так.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

UDP Connection refused

inkognito0609 March 12, 2020 02:32AM

Re: UDP Connection refused

Evgeniy Berdnikov March 12, 2020 05:52AM

Re: UDP Connection refused

Maxim Dounin March 12, 2020 08:36AM

Re: UDP Connection refused

inkognito0609 March 20, 2020 04:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 258
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready