tc.downloadTool takes almost 2hours **sometimes** for a small file
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I created an action to locate, download and install the Qt Installer Framework (QtIFW) so it could be used to create installer packages (for C++ code for eg). https://github.com/jmarrec/setup-qtifw/actions
Bottom line is that one point I:
- log a message
- do
tc.downloadTool(link) - log a message
On some occasions, the time span between the begin and end of download is almost 2 hours. This is a 70MB file, and usually it takes about 15 seconds to run the entire action.
Details
I suck at typescript (I have never coded in typescript before today and barely ever done any JavaScript), but I don't think I made something too stupid.
The relevant code are these few lines: https://github.com/jmarrec/setup-qtifw/blob/e0a3ad09252ad4311fedf1fc0252ce4eab9f1b7a/src/install-qtifw.ts#L27-L40 which can be reduced down to:
const installerLink = 'https://download.qt.io/official_releases/qt-installer-framework/4.1.1/QtInstallerFramework-linux-x64-4.1.1.run';
// Avoid a Redirect from HTTPS to HTTP protocol error
const downloadUrl = installerLink.replace('https:', 'http:');
core.info(`Download from "${downloadUrl}"`);
const qtIFWPathDest = path.join('./tmp/, path.basename(downloadUrl));
const qtIFWPath: string = await tc.downloadTool(downloadUrl, qtIFWPathDest);
core.info(`Downloaded installer at "${qtIFWPath}"`);
Demonstration of the issue in workflow runs
A run where I use my action and see the gigantic time lag can be found on https://github.com/jmarrec/EnergyPlus/runs/2897194531?check_suite_focus=true. You'll see that it took 1h51 minute, whereas it took 18s on the 20.04 run...
Extract from the raw log, (ACTION_STEP_DEBUG=true)
2021-06-23T16:41:22.3510271Z Download from "http://download.qt.io/official_releases/qt-installer-framework/4.1.1/QtInstallerFramework-linux-x64-4.1.1.run"
2021-06-23T16:41:22.3516591Z ##[debug]Working Directory: /home/runner/work/_temp/4c3b9f4a-8ad6-4dba-bc8f-642069d126af
2021-06-23T16:41:22.3536626Z ##[debug]Downloading http://download.qt.io/official_releases/qt-installer-framework/4.1.1/QtInstallerFramework-linux-x64-4.1.1.run
2021-06-23T16:41:22.3539771Z ##[debug]Destination /home/runner/work/_temp/4c3b9f4a-8ad6-4dba-bc8f-642069d126af/QtInstallerFramework-linux-x64-4.1.1.run
[ new lines are mine, for emphasis ]
2021-06-23T18:32:33.1290121Z ##[debug]download complete
2021-06-23T18:32:33.1331687Z Downloaded installer at "/home/runner/work/_temp/4c3b9f4a-8ad6-4dba-bc8f-642069d126af/QtInstallerFramework-linux-x64-4.1.1.run"
Additionally, here is a test workflow on my action repo that uses ubuntu 18.04 to download the exact same version and takes 20s to run: https://github.com/jmarrec/setup-qtifw/runs/2898720216?check_suite_focus=true
Expected behavior
It should not hang for 2 hours? I thought it would timeout or something at least
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the toolkit entry point for tc.downloadTool and compare its debug output with the provided workflow logs and the successful Ubuntu 18.04 run. Investigate why the 70MB download can take nearly two hours instead of completing promptly, then verify the behavior with a reproducible download test or workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100