I am on server 192.168.0.2 and want to make an HTTP call to 192.168.0.1(both servers are RPis and run Linux (raspbian)).
curl -XGET http://192.168.0.1:8081/api
The API on 192.168.0.1 (which I am calling) is mine (a Python script based on bottle) and works most of the time. The HTTP listening part sometimes mysteriously hangs, which results with the curl call above hanging, then timing out.
I ran tcpdump on 192.168.0.1 (the receiving server, the one which hosts the API) when the API was non responsive and the wireshark analysis shows some retransmissions right after the call is initiated:
What is usually the cause of such behaviour? (if there is a "usual" cause).
Note 1: If needed, I will modify the API so that it logs more data for the webserver part but due to the non-reproducible nature of the hang, I doubt that it is its fault (the other pieces (threads) work great and there is no crash of any thread).
Note 2: rebooting the server (also probably restarting the script itself (which I do not do as I rather reboot the machine)) fixes the problem.
