![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Windows: AnyEvent -> HTTP -> DNS - > Blocking for minutesby sectokia (Pilgrim) |
on Oct 12, 2022 at 03:08 UTC ( #11147363=perlquestion: print w/replies, xml ) | Need Help?? |
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
Back to
Seekers of Perl Wisdom
|
|