cloudflare-ddns icon indicating copy to clipboard operation
cloudflare-ddns copied to clipboard

Fix the issue that requests may hang

Open yanggl29 opened this issue 2 years ago â€ĸ 3 comments

For some reasons, I get an issue that could not update DNS record repeatedly by docker. When I checked the logs, I found logs without timestamps, making it difficult to debug. And I attempted to debug by using gdb and pstack. It turns out that it just doesn't work. The last logs I get looks like: 📡 Updating record {'type': 'A', 'name': 'my.domain', 'content': 'ip4', 'proxied': False, 'ttl': 300} 📡 Updating record {'type': 'AAAA', 'name': 'my.domain', 'content': 'ipv6', 'proxied': False, 'ttl': 300} However, what I see in Cloudflare shows that the time of the last audit log is the time when I started the Docker container. I cannot verify it because of the lack of timestamp in the log. For this purpose, I create this pull request.

yanggl29 avatar Dec 22 '23 13:12 yanggl29

Finally, I found where the problem is. In some regions on Earth, requests may never get a response. To deal with this situation, we need to add a timeout parameter to throw an Exception when a timeout occurs. I reproduced this issue by doing nothing. It will always reproduce, and the stack shows it hangs on the method 'hand_shake'.

Changes include:

  1. Add the parameter 'timeout' to handle the case when a timeout occurs.
  2. Add logging to custom log level for some extra information.

yanggl29 avatar Dec 23 '23 02:12 yanggl29

I'm experiencing similar issues as described in OP. @timothymiller any chance we could get this merged?

DerZade avatar Feb 02 '24 22:02 DerZade

#157 should also be checked. It alters also the output.

QbikEdge avatar Jul 31 '24 02:07 QbikEdge