Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue that requests may hang #173

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yanggl29
Copy link

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 yanggl29 force-pushed the master branch 3 times, most recently from e3e22dc to a7d70e4 Compare December 23, 2023 02:23
@yanggl29 yanggl29 changed the title Print time in log for debugging Fix the issue that requests may hang Dec 23, 2023
@yanggl29
Copy link
Author

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.

@DerZade
Copy link

DerZade commented Feb 2, 2024

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

@QbikEdge QbikEdge mentioned this pull request Jul 31, 2024
@QbikEdge
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants