Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: QNetworkAccessManager smart handling of timeouts / network errors

  1. #21

    Default Re: QNetworkAccessManager smart handling of timeouts / network errors

    i'm probably having a similar issue to what is discussed here, please also see:
    https://qt-project.org/forums/viewthread/11763

    i've created a minimal QCoreApplication example and engineered a network setup which is reproducible on your system, so in a nutshell: you can now reproduce this bug, see:
    https://github.com/qknight/qt-QNetwo...9f2ef661d4dcb1

    *there is one difference though*:

    i had this issue also with *QNetworkAccessManager* but after playing with the issue for a while (/etc/resolv.conf) i now think it is DNS related so i was looking into *QHostInfo::lookupHost*

    but the *README.MD* contains a detailed description of the setup and tests i was using/doing.

    i'm using:
    * qt-4.8.4
    * nixos linux (nixos.org)
    * kernel 3.4.56

    some experiments
    i made some experiments with iptables and since DNS uses UDP on my system (not TCP as shown in the rules above) i modified them slightly:
    iptables -D OUTPUT -d 8.8.8.8 -j DROP

    surprisingly this rule made the shutdown process, which would normally timeout with 40 seconds, succeed in no time (say 5ms). for some reason a local process just knows that the DNS resolver fails.

    gethostip shows the same behaviour:

    % time gethostip lastlog.de
    lastlog.de: Unknown host
    gethostip lastlog.de 0.00s user 0.00s system 75% cpu 0.005 total

    summary: using the iptables rule does not help to reproduce the issue but hides it instead! so better use this setup to reproduce it:

    host pc ---- switch1 ---- switch2 ----- internet

    and then unplug switch2 so that networkmanager/ifplugd (or similar) won't notice that the cable has been unplugged.

    anyway, have a look at the README.MD file in the repo above. as described there i will now try to modify the Qt toolkit to ignore the DNS resoler on shutdown - maybe that is possible.

    feedback welcome. my jabber: flux@jabber.ccc.de

    best wishes,
    joachim schiele

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QNetworkAccessManager smart handling of timeouts / network errors

    Does the same thing happen when using code that doesn't make use of Qt? If no, what are the differences in code and behavior, if yes - why are you asking this question relating it to Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #23

    Default Re: QNetworkAccessManager smart handling of timeouts / network errors

    i've made some traces and an minimal example to illustrate the problem, my repo on github.com linked below.

    discussion

    qt-QNetworkAccessManager-issues discussion:
    https://github.com/qknight/qt-QNetwo...593#discussion

    possible solution(s)

    qt-QNetworkAccessManager-issues solution(s):
    https://github.com/qknight/qt-QNetwo...ible-solutions

    summary: in a nutshell

    Qt's getaddrinfo(..) abstraction must be changed to make the lookupHost(..) call _really_ async. right now it is sync, when the network connection between client and DNS server is interrupted, which isn't that seldom as one might expect.

    should i fill a bug report? this problem isn't solved at all! ;-)

  4. #24

    Default Re: QNetworkAccessManager smart handling of timeouts / network errors

    i’ve added a new bug here, hope this is the right tracker!
    https://bugreports.qt-project.org/browse/QTBUG-33391
    thanks

  5. #25
    Join Date
    Feb 2013
    Posts
    65
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QNetworkAccessManager smart handling of timeouts / network errors

    @krsmichael Thank you so much! Adding those dlls worked for me. It seems Qt will write empty files if there is a network error. I was checking for this in my app to isolate the problem. My app downloads from an https site. Worked on my development PC (Windows 10) because Qt was in the path of the user and the files are located in the folder QtCreator/bin. But running my app in VirtualBox failed because it couldn't find the dlls. Thanks again so much!

Similar Threads

  1. QNetworkAccessManager and network errors
    By lukass in forum Newbie
    Replies: 8
    Last Post: 23rd February 2011, 10:23
  2. Network statistics with QNetworkAccessManager
    By The_Fallen in forum Qt Programming
    Replies: 7
    Last Post: 20th September 2010, 01:01
  3. get network stream with QNetworkAccessManager
    By Remco in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2010, 16:25
  4. Replies: 0
    Last Post: 7th August 2010, 09:55
  5. QNetworkAccessManager get request causing QSslSocket errors
    By Runtime Technologies in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2009, 22:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.