Tarantool development patches archive
 help / color / mirror / Atom feed
From: Roman Khabibov <roman.habibov@tarantool.org>
To: Sergey Ostanevich <sergos@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] lua: return getaddrinfo() errors
Date: Sun, 26 Apr 2020 19:26:30 +0300	[thread overview]
Message-ID: <2A673E1E-AEFC-4912-8782-7B88AEA049C2@tarantool.org> (raw)
In-Reply-To: <20200426154623.3trqdm7xhly6rxwe@tkn_work_nb>



> On Apr 26, 2020, at 18:46, Alexander Turenko <alexander.turenko@tarantool.org> wrote:
> 
> On Sun, Apr 26, 2020 at 06:16:29AM +0300, Roman Khabibov wrote:
>> 
>> 
>>> On Apr 24, 2020, at 20:18, Sergey Ostanevich <sergos@tarantool.org> wrote:
>>> 
>>> On 24 апр 14:42, Roman Khabibov wrote:
>>>> Hi! Thanks for the review.
>>>> 
>>>>> On Apr 16, 2020, at 13:27, Sergey Ostanevich <sergos@tarantool.org> wrote:
>>>>> 
>>>>> On 06 апр 05:08, Roman Khabibov wrote:
>>>>>>>> +test_run:cmd("setopt delimiter ';'")
>>>>>>>> +function check_err(err)
>>>>>>>> +    if err == 'getaddrinfo: nodename nor servname provided, or not known' or
>>>>>>>> +       err == 'getaddrinfo: Servname not supported for ai_socktype' or
>>>>>>>> +       err == 'getaddrinfo: Name or service not known' or
>>>>>>>> +       err == 'getaddrinfo: hostname nor servname provided, or not known' or
>>>>>>>> +       err == 'getaddrinfo: Temporary failure in name resolution' or
>>>>>>>> +       err == 'getaddrinfo: Name could not be resolved at this time' then
>>>>>>>> +        return true
>>>>>>>> +    end
>>>>>>>> +    return false
>>>>>>>> +end;
>>>>>>> I really doubt that different error messages from the set above will appear 
>>>>>>> for the same error on different platforms. Could you please check for particular 
>>>>>>> output for each case you trigger below?
>>>>>> Look at that:
>>>>>> https://travis-ci.org/github/tarantool/tarantool/jobs/546115892#L3581 - Linux failed
>>>>>> https://travis-ci.org/github/tarantool/tarantool/jobs/546115893#L3100 - macOS isn’t
>>>>>> 
>>>>> 
>>>>> Exactly, this means for the error EAI_NONAME those OSes have differnet
>>>>> messages. But you've put different errors in one bunch - I meant it
>>>>> should never return 'Temporary failure in name resolution' as a result
>>>>> for EAI_SERVICE, right? 
>>>>> 
>>>>> Are you testing for correct error returned for a particular case?
>>>> Don’t understand the question. I just check error messages that appeared
>>>> after travis/gitlab testing.
>>>> 
>>> Different errors makes different messages. 
>>> Same error can make different messages on different platforms. 
>>> 
>>> You put both into one: you don't care about what exact error came to
>>> you, right? 
>> Right. The most important thing here is that the error is from getaddrinfo.
> 
> Here I disagree. We want to verify that an error from a specific set of
> errors occurs. AFAIR, three errors are possible when trying to resolve a
> non-existent hostname: EAI_NONAME, EAI_AGAIN (and, as I see from the
> messages, EAI_SERVICE; maybe it is when ipv6 is semi-configured like on
> travis-ci).
> 
> Actual EAI_* error for the test depends on network conditions and host
> configuration, messages are platform dependent.
> 
> See also:
> https://lists.tarantool.org/pipermail/tarantool-patches/2019-August/003399.html
> 
> Roman, I suggest to clarify things that Sergos asked in the comments
> near to the check: if it is not clear for a reviewer, then a future
> reader may hang with it too.
Ok, Sergos, can you just show me what is wrong in this code. Sorry, but I
can’t figure out. There is the set of error messages, and there is the
corresponding constants. If several error messages correspond to the same
constant, then these messages are for different OS.

+-- gh-4138 Check getaddrinfo() error from socket:connect() only.
+-- Error code and error message returned by getaddrinfo() depends
+-- on system's gai_strerror().
+test_run:cmd("setopt delimiter ';'")
+function check_err(err)
+-- EAI_NONAME
+    if err == 'getaddrinfo: nodename nor servname provided, or not known' or
+-- EAI_SERVICE
+       err == 'getaddrinfo: Servname not supported for ai_socktype' or
+-- EAI_NONAME
+       err == 'getaddrinfo: Name or service not known' or
+-- EAI_NONAME
+       err == 'getaddrinfo: hostname nor servname provided, or not known' or
+-- EAI_AGAIN
+       err == 'getaddrinfo: Temporary failure in name resolution' or
+-- EAI_AGAIN
+       err == 'getaddrinfo: Name could not be resolved at this time' then
+        return true
+    end
+    return false
+end;

> And, please (AFAIR I already asked), comment which message is for which
> EAI_* constant.
> 
> WBR, Alexander Turenko.

  reply	other threads:[~2020-04-26 16:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 10:24 [Tarantool-patches] [PATCH v2 0/2] Return " Roman Khabibov
2020-03-12 10:24 ` [Tarantool-patches] [PATCH v2 1/2] coio/say: fix getaddrinfo error handling on macOS Roman Khabibov
2020-03-29  8:51   ` Sergey Ostanevich
2020-03-29  9:12     ` Alexander Turenko
2020-04-06  2:07     ` Roman Khabibov
2020-04-17  9:37       ` Sergey Ostanevich
2020-04-24 11:32         ` Roman Khabibov
2020-06-23 13:27         ` Roman Khabibov
2020-07-23 14:12           ` Sergey Ostanevich
2020-07-28  9:26             ` Roman Khabibov
2020-04-26 17:20   ` Vladislav Shpilevoy
2020-03-12 10:24 ` [Tarantool-patches] [PATCH v2 2/2] lua: return getaddrinfo() errors Roman Khabibov
2020-03-29  9:07   ` Sergey Ostanevich
2020-03-29  9:25     ` Alexander Turenko
2020-04-06  2:08     ` Roman Khabibov
2020-04-16 10:27       ` Sergey Ostanevich
2020-04-24 11:42         ` Roman Khabibov
2020-04-24 17:18           ` Sergey Ostanevich
2020-04-26  3:16             ` Roman Khabibov
2020-04-26 15:46               ` Alexander Turenko
2020-04-26 16:26                 ` Roman Khabibov [this message]
2020-07-13  9:51                   ` sergos
2020-07-28 14:08 ` [Tarantool-patches] [PATCH v2 0/2] Return " Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2A673E1E-AEFC-4912-8782-7B88AEA049C2@tarantool.org \
    --to=roman.habibov@tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/2] lua: return getaddrinfo() errors' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox