Fix deadlock in ImageLoader, FileLoader, EhttpLoader#7494
Merged
lucasmerlin merged 4 commits intomainfrom Sep 4, 2025
Merged
Conversation
ImageLoader, FileLoader, EhttpLoader
|
Preview available at https://egui-pr-preview.github.io/pr/7494-lucasfix-image-loader-deadlock |
emilk
approved these changes
Sep 4, 2025
| if cfg!(debug_assertions) { | ||
| self.0 | ||
| .try_lock_for(std::time::Duration::from_secs(30)) | ||
| .try_lock_for(DEADLOCK_DURATION) |
Owner
There was a problem hiding this comment.
We should document this on the docstrings for Mutex and RwLock, i.e. that they are meant for very short locks, and are meant for internal use in egui
Collaborator
Author
There was a problem hiding this comment.
Ill do this in a seperate PR where I also remove the deadlock_detection feature
emilk
pushed a commit
that referenced
this pull request
Sep 4, 2025
* related #7494 Removes the `deadlock_detection` feature, since we now have a more primitive panic-after-30s deadlock detection which works well enough and even detects kinds of deadlocks that the `deadlock_detection` feature never supported.
lucasmerlin
added a commit
that referenced
this pull request
Sep 4, 2025
* Recently CI runs started to hang randomly: https://github.com/emilk/egui/actions/runs/17427449210/job/49477714447?pr=7359 This fixes the deadlock and adds the basic deadlock detection we also added to Mutexes in #7468. Also, interestingly, the more sophisticated deadlock detection (behind the deadlock_detection feature) didn't catch this for some reason. I wonder why it exists in the first place, when parking_lot also has built in deadlock detection? It also seems to make tests slower, widget_tests usually needs ~30s, with the deadlock detection removed its only ~12s.
lucasmerlin
added a commit
that referenced
this pull request
Sep 4, 2025
* related #7494 Removes the `deadlock_detection` feature, since we now have a more primitive panic-after-30s deadlock detection which works well enough and even detects kinds of deadlocks that the `deadlock_detection` feature never supported.
Masterchef365
pushed a commit
to Masterchef365/egui
that referenced
this pull request
Apr 3, 2026
* Recently CI runs started to hang randomly: https://github.com/emilk/egui/actions/runs/17427449210/job/49477714447?pr=7359 This fixes the deadlock and adds the basic deadlock detection we also added to Mutexes in emilk#7468. Also, interestingly, the more sophisticated deadlock detection (behind the deadlock_detection feature) didn't catch this for some reason. I wonder why it exists in the first place, when parking_lot also has built in deadlock detection? It also seems to make tests slower, widget_tests usually needs ~30s, with the deadlock detection removed its only ~12s.
Masterchef365
pushed a commit
to Masterchef365/egui
that referenced
this pull request
Apr 3, 2026
* related emilk#7494 Removes the `deadlock_detection` feature, since we now have a more primitive panic-after-30s deadlock detection which works well enough and even detects kinds of deadlocks that the `deadlock_detection` feature never supported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the deadlock and adds the basic deadlock detection we also added to Mutexes in #7468.
Also, interestingly, the more sophisticated deadlock detection (behind the deadlock_detection feature) didn't catch this for some reason. I wonder why it exists in the first place, when parking_lot also has built in deadlock detection? It also seems to make tests slower, widget_tests usually needs ~30s, with the deadlock detection removed its only ~12s.