Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Linux, the way to get rid of boot viruses -- MaDsen Wikholm, mwikholm@at8.abo.fi


devel / comp.lang.python / Re: http.client and dns lookups

SubjectAuthor
* Re: http.client and dns lookupsBarry
`* Re: http.client and dns lookupsMichael Welle
 +- Re: http.client and dns lookupsBarry
 `- Re: http.client and dns lookupsDieter Maurer

1
Re: http.client and dns lookups

<mailman.7.1643735165.2976.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16839&group=comp.lang.python#16839

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: http.client and dns lookups
Date: Tue, 1 Feb 2022 17:05:52 +0000
Lines: 27
Message-ID: <mailman.7.1643735165.2976.python-list@python.org>
References: <25080.12886.84182.252875@ixdm.fritz.box>
<D9D4F283-BBCC-480A-922C-ABE0CF3740B6@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de KaVdJXh2LHERvfH4HU054gZo62W/y1wg886abJbM5f4w==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'e.g.': 0.07; 'underlying':
0.07; 'cc:addr:python-list': 0.09; 'dns': 0.09; 'from:addr:barry':
0.09; 'library,': 0.09; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'cc:no real name:2**0': 0.14; 'url:mailman': 0.15; '19:22,': 0.16;
'2022,': 0.16; 'barry': 0.16; 'dieter': 0.16; 'from:addr:barrys-
emacs.org': 0.16; 'message-id:@barrys-emacs.org': 0.16;
'outdated': 0.16; 'recall.': 0.16; 'runtime': 0.16; 'turns': 0.16;
'unlikely': 0.16; 'wrote:': 0.16; 'python': 0.16; 'uses': 0.19;
'cc:addr:python.org': 0.20; 'machine': 0.22; 'application.': 0.22;
'cc:2**1': 0.23; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'url-
ip:188.166/16': 0.25; 'url-ip:188/8': 0.31; 'server': 0.33;
'header:In-Reply-To:1': 0.34; 'running': 0.34; 'functions': 0.36;
'change': 0.36; 'using': 0.37; 'wrote': 0.39; 'still': 0.40;
'something': 0.40; 'received:217': 0.67; 'skip:/ 10': 0.69;
'ability': 0.71; 'itself.': 0.84; 'performs': 0.93
In-Reply-To: <25080.12886.84182.252875@ixdm.fritz.box>
X-Mailer: iPad Mail (19C63)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <D9D4F283-BBCC-480A-922C-ABE0CF3740B6@barrys-emacs.org>
X-Mailman-Original-References: <25080.12886.84182.252875@ixdm.fritz.box>
 by: Barry - Tue, 1 Feb 2022 17:05 UTC

> On 31 Jan 2022, at 19:22, Dieter Maurer <dieter@handshake.de> wrote:
>
> Michael Welle wrote at 2022-1-30 09:18 +0100:
>> ...
> The machine this is running on regularly switches
>> its network configuration without restarting the Python application. Now
>> it turns out that the application is still using an old, outdated dns
>> server after such a network configuration switch.
>
> It is unlikely that Python performs the host -> IP address translation
> itself. Almost surely, the translation is delegated to functions
> of the underlying C runtime library, e.g. "gethostbyname".

And glibc does not have the ability to reload the /etc/resolv.conf I recall.
If you rely on that you will need to change to using something like dnsmasq or systemd-resolved so that resolv.conf uses localhost.

Barry

> --
> https://mail.python.org/mailman/listinfo/python-list
>

Re: http.client and dns lookups

<vmaocix7f2.ln2@news.c0t0d0s0.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16840&group=comp.lang.python#16840

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.dynamic-046-114-106-120.46.114.pool.telefonica.de!not-for-mail
From: mwe012...@gmx.net (Michael Welle)
Newsgroups: comp.lang.python
Subject: Re: http.client and dns lookups
Date: Tue, 01 Feb 2022 19:28:15 +0100
Organization: MB-NET.NET for Open-News-Network e.V.
Message-ID: <vmaocix7f2.ln2@news.c0t0d0s0.de>
References: <25080.12886.84182.252875@ixdm.fritz.box>
<D9D4F283-BBCC-480A-922C-ABE0CF3740B6@barrys-emacs.org>
<mailman.7.1643735165.2976.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: gwaiyur.mb-net.net; posting-host="dynamic-046-114-106-120.46.114.pool.telefonica.de:46.114.106.120";
logging-data="2902430"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:Fw+dLWWtOocnOFjLgVqH0xCGGf8=
X-User-ID: U2FsdGVkX19Q2HOoZa8nenr75K1y36KlL//GdQIu492xlFt8hGKsaQ==
X-No-Archive: Yes
 by: Michael Welle - Tue, 1 Feb 2022 18:28 UTC

Hello,

Barry <barry@barrys-emacs.org> writes:

>> On 31 Jan 2022, at 19:22, Dieter Maurer <dieter@handshake.de> wrote:
>>
>> Michael Welle wrote at 2022-1-30 09:18 +0100:
>>> ...
>> The machine this is running on regularly switches
>>> its network configuration without restarting the Python application. Now
>>> it turns out that the application is still using an old, outdated dns
>>> server after such a network configuration switch.
>>
>> It is unlikely that Python performs the host -> IP address translation
>> itself. Almost surely, the translation is delegated to functions
>> of the underlying C runtime library, e.g. "gethostbyname".
>
> And glibc does not have the ability to reload the /etc/resolv.conf I recall.
> If you rely on that you will need to change to using something like
> dnsmasq or systemd-resolved so that resolv.conf uses localhost.
hmmm, I don't know if that's all. For a test I just changed
/etc/resolv.conf manually while the application was sleeping. After
returning from sleep the application knew the change I had made in
resolv.conf and, interestingly, an exception (name resolution failure,
which is correct with the change I made) surfaces in the application.
That doesn't happen when the 'real' issue occurs. Attaching strace to
the Python process I can see that resolv.conf is stat'ed and open'ed. I
guess now I'm more confused than before ;). There must be an additional
condition that I'm missing.

Thanks for helping
hmw

Re: http.client and dns lookups

<mailman.9.1643752848.2976.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16842&group=comp.lang.python#16842

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: http.client and dns lookups
Date: Tue, 1 Feb 2022 22:00:35 +0000
Lines: 47
Message-ID: <mailman.9.1643752848.2976.python-list@python.org>
References: <vmaocix7f2.ln2@news.c0t0d0s0.de>
<0F5894EA-A511-4174-B987-F4FDFE407B8B@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de iuxZbutGBWhbg7TA+lg/KAIA+uKMzMGJZ5b4OCx5/fzA==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'e.g.': 0.07; 'underlying':
0.07; 'cc:addr:python-list': 0.09; 'dns': 0.09; 'from:addr:barry':
0.09; 'library,': 0.09; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'writes:': 0.09; 'cc:no real name:2**0': 0.14; 'url:mailman':
0.15; '19:22,': 0.16; '2022,': 0.16; '>>>>': 0.16; 'barry': 0.16;
'confused': 0.16; 'dieter': 0.16; 'from:addr:barrys-emacs.org':
0.16; 'message-id:@barrys-emacs.org': 0.16; 'outdated': 0.16;
'recall.': 0.16; 'resolution': 0.16; 'runtime': 0.16; 'turns':
0.16; 'unlikely': 0.16; '\xef\xbb\xbfhello,': 0.16; 'wrote:':
0.16; 'python': 0.16; 'feb': 0.17; 'uses': 0.19;
'cc:addr:python.org': 0.20; 'issue': 0.21; 'machine': 0.22;
'application.': 0.22; 'exception': 0.22; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25;
'>>>': 0.28; 'url-ip:188/8': 0.31; "doesn't": 0.32; 'attaching':
0.32; 'guess': 0.32; 'returning': 0.32; "i'm": 0.33; 'there':
0.33; 'server': 0.33; 'header:In-Reply-To:1': 0.34; 'running':
0.34; 'functions': 0.36; 'change': 0.36; 'using': 0.37; 'thanks':
0.38; 'wrote': 0.39; 'still': 0.40; 'happen': 0.40; 'something':
0.40; 'michael': 0.60; 'ago.': 0.64; 'received:217': 0.67; 'and,':
0.69; 'manually': 0.69; 'skip:/ 10': 0.69; 'ability': 0.71;
'little': 0.73; 'failure,': 0.84; 'itself.': 0.84; 'sleeping.':
0.84; 'performs': 0.93
In-Reply-To: <vmaocix7f2.ln2@news.c0t0d0s0.de>
X-Mailer: iPad Mail (19D50)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <0F5894EA-A511-4174-B987-F4FDFE407B8B@barrys-emacs.org>
X-Mailman-Original-References: <vmaocix7f2.ln2@news.c0t0d0s0.de>
 by: Barry - Tue, 1 Feb 2022 22:00 UTC

> On 1 Feb 2022, at 19:21, Michael Welle <mwe012008@gmx.net> wrote:
>
> Hello,
>
> Barry <barry@barrys-emacs.org> writes:
>
>>>> On 31 Jan 2022, at 19:22, Dieter Maurer <dieter@handshake.de> wrote:
>>>
>>> Michael Welle wrote at 2022-1-30 09:18 +0100:
>>>> ...
>>> The machine this is running on regularly switches
>>>> its network configuration without restarting the Python application. Now
>>>> it turns out that the application is still using an old, outdated dns
>>>> server after such a network configuration switch.
>>>
>>> It is unlikely that Python performs the host -> IP address translation
>>> itself. Almost surely, the translation is delegated to functions
>>> of the underlying C runtime library, e.g. "gethostbyname".
>>
>> And glibc does not have the ability to reload the /etc/resolv.conf I recall.
>> If you rely on that you will need to change to using something like
>> dnsmasq or systemd-resolved so that resolv.conf uses localhost.
> hmmm, I don't know if that's all. For a test I just changed
> /etc/resolv.conf manually while the application was sleeping. After
> returning from sleep the application knew the change I had made in
> resolv.conf and, interestingly, an exception (name resolution failure,
> which is correct with the change I made) surfaces in the application.
> That doesn't happen when the 'real' issue occurs. Attaching strace to
> the Python process I can see that resolv.conf is stat'ed and open'ed. I
> guess now I'm more confused than before ;). There must be an additional
> condition that I'm missing.

That is good to know, last time I hit this was on centos 6 a little while ago.

Barry

>
> Thanks for helping
> hmw
> --
> https://mail.python.org/mailman/listinfo/python-list

Re: http.client and dns lookups

<mailman.16.1643824720.2976.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16850&group=comp.lang.python#16850

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: die...@handshake.de (Dieter Maurer)
Newsgroups: comp.lang.python
Subject: Re: http.client and dns lookups
Date: Wed, 2 Feb 2022 18:58:31 +0100
Lines: 9
Message-ID: <mailman.16.1643824720.2976.python-list@python.org>
References: <25080.12886.84182.252875@ixdm.fritz.box>
<D9D4F283-BBCC-480A-922C-ABE0CF3740B6@barrys-emacs.org>
<mailman.7.1643735165.2976.python-list@python.org>
<vmaocix7f2.ln2@news.c0t0d0s0.de>
<25082.50759.381474.118187@ixdm.fritz.box>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de JBWUoamgum7ePmbkDaC6dATvLuqUD46z1e/VzNYAuU4g==
Return-Path: <dieter@handshake.de>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.034
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'cc:addr:python-list':
0.09; 'dns': 0.09; 'cc:no real name:2**0': 0.14; '(apparently':
0.16; 'confused': 0.16; 'outdated': 0.16; 'python': 0.16;
'values': 0.17; 'uses': 0.19; 'cc:addr:python.org': 0.20; 'issue':
0.21; 'received:de': 0.23; 'cc:2**0': 0.25; "doesn't": 0.32;
'attaching': 0.32; "i'm": 0.33; 'there': 0.33; 'header:In-Reply-
To:1': 0.34; 'wrote': 0.39; 'happen': 0.40; 'michael': 0.60;
'service': 0.64; 'header:Received:6': 0.67; 'non': 0.75;
'received:88': 0.84
In-Reply-To: <vmaocix7f2.ln2@news.c0t0d0s0.de>
X-Mailer: VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid
(x86_64-linux-gnu)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <25082.50759.381474.118187@ixdm.fritz.box>
X-Mailman-Original-References: <25080.12886.84182.252875@ixdm.fritz.box>
<D9D4F283-BBCC-480A-922C-ABE0CF3740B6@barrys-emacs.org>
<mailman.7.1643735165.2976.python-list@python.org>
<vmaocix7f2.ln2@news.c0t0d0s0.de>
 by: Dieter Maurer - Wed, 2 Feb 2022 17:58 UTC

Michael Welle wrote at 2022-2-1 19:28 +0100:
> ...
>That doesn't happen when the 'real' issue occurs. Attaching strace to
>the Python process I can see that resolv.conf is stat'ed and open'ed. I
>guess now I'm more confused than before ;). There must be an additional
>condition that I'm missing.

The DNS service routinely uses caches. Outdated cache values
can cause (apparently non deterministic) failures.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor