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

Subsequent requests in HTTPRequest don't resolve after #49026 #49261

Closed
YuriSizov opened this issue Jun 2, 2021 · 3 comments · Fixed by #49269
Closed

Subsequent requests in HTTPRequest don't resolve after #49026 #49261

YuriSizov opened this issue Jun 2, 2021 · 3 comments · Fixed by #49269

Comments

@YuriSizov
Copy link
Contributor

Godot version:

master @ 9990f28

OS/device including version:

Windows 10

Issue description:

#49026 breaks file downloading (e.g. export templates downloading in the editor). The download stops at an unassuming status STATUS_DISCONNECTED:

image

If use_threads is disabled, the status changes to STATUS_RESOLVING, but it still stops at that and never downloads anything.

image

Code that doesn't work:

	download_templates->set_download_file(EditorPaths::get_singleton()->get_cache_dir().plus_file("tmp_templates.tpz"));
	download_templates->set_use_threads(true);

	Error err = download_templates->request(p_url);

But requests like this do work:

	request_mirror->request("https://godotengine.org/mirrorlist/" + p_version + ".json");

Steps to reproduce:
Build master from 9990f28 with version.py set to a valid stable release, then try to download export templates from the editor. Mirror list is successfully fetched, but file download hangs as described above.

Minimal reproduction project:

Not applicable.

@akien-mga
Copy link
Member

CC @sarchar @Faless

@sarchar
Copy link
Contributor

sarchar commented Jun 3, 2021

I was able to reproduce this same bug in c5f237e, so I don't think it's related to the DNS request. Nevermind. Looks related to DNS now, something with the mutex lock not being released. On it.

Probably related, if you close the dialog while it says "Disconnected", and then re open the dialog by clicking "Download", the Mirrors list also fails to be retrieved.

Also interesting is that after closing that templates dialog, the editor fails to exit - it seems to lock up as if it's waiting on something (like a background thread that fails to exit?)

@sarchar
Copy link
Contributor

sarchar commented Jun 3, 2021

I have a fix and will create a PR shortly.

@YuriSizov YuriSizov changed the title File downloading with HTTPRequest doesn't work after #49026 Subsequent requests in HTTPRequest don't resolve after #49026 Jun 3, 2021
sarchar added a commit to sarchar/godot that referenced this issue Jun 3, 2021
This fixes godotengine#49261, which was happening because of a deadlock in the resolver mutex.  There was leftover old mutex code and it's all be converted to new MutexLock class now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants