sectokia has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
On windows, perl will block completely for many minutes if there is no connection to a DNS server when you are using AnyEvent::HTTP. The issue seems to be AnyEvent::HTTP uses AnyEvent::DNS which on windows doesn't have a proper async way to make DNS calls and instead falls back to Net::DNS::Resolver (which is blocking) and AnyEvent::DNS doesn't otherwise set timeouts, so the default timeouts occur (which are several minutes).
This means if there is no connection to the DNS server, then all events under AnyEvent can't run until the timeout elapses after a few minutes.
I thought I could cludge around this somewhat by lowering the timeouts, but the dynamic way in which Net::DNS::Resolve is called means I can't redefine the _defaults function, as it gets re-defined each time AnyEvent::DNS calls it.
Anyone got any ideas to work around this? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windows: AnyEvent -> HTTP -> DNS - > Blocking for minutes
by NERDVANA (Priest) on Oct 13, 2022 at 03:06 UTC | |
by sectokia (Friar) on Oct 19, 2022 at 09:28 UTC | |
by NERDVANA (Priest) on Oct 20, 2022 at 02:36 UTC | |
by hippo (Archbishop) on Oct 20, 2022 at 08:43 UTC | |
by sectokia (Friar) on Oct 20, 2022 at 04:26 UTC | |
by NERDVANA (Priest) on Oct 20, 2022 at 23:12 UTC | |
|