lanrat / czds

simple golang API and tools to interact with czds.icann.org
https://pkg.go.dev/github.com/lanrat/czds
GNU General Public License v3.0
72 stars 14 forks source link

New Timeout Code Breaks .com Zone File #7

Closed neonbunny closed 3 years ago

neonbunny commented 3 years ago

The recent timeout code change which formed v1.0.1 appears to break the download of the largest zone file (.com) when running even on a reasonably spec'ed connection (AWS EC2 system with "Up to 10Gbps" bandwidth).

Since the update, I am now seeing:

2021/06/21 08:34:45 downloading 'https://czds-api.icann.org/czds/downloads/com.zone'
2021/06/21 08:34:45 downloading 'https://czds-api.icann.org/czds/downloads/photo.zone'
<SNIP>
2021/06/21 08:34:52 downloading 'https://czds-api.icann.org/czds/downloads/softbank.zone'
2021/06/21 08:34:52 downloading 'https://czds-api.icann.org/czds/downloads/kerryproperties.zone'
2021/06/21 08:39:45 [com.zone] err: context deadline exceeded (Client.Timeout or context cancellation while reading body)
2021/06/21 08:39:45 downloading 'https://czds-api.icann.org/czds/downloads/com.zone'

The file left on disk is considered corrupted by the zip tool, presumably because it is incomplete.

lanrat commented 3 years ago

Thanks for the report.

I changed the timeout logic to fix some timeouts in the other API calls and simplify the logic.

Com was working for me (single server in colo with a 500mbps connection) but I agree that the timeout should be more lax for the larger zones for slower transfer rates. I'll work on getting a fix out soon.

lanrat commented 3 years ago

This should be fixed in v1.0.2. Let me know if you have any other issues.