After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791400 - Hang when opening Epiphany project
Hang when opening Epiphany project
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-08 17:56 UTC by Michael Catanzaro
Modified: 2017-12-09 06:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-monitor: improve ignored directory checks (3.45 KB, patch)
2017-12-09 06:34 UTC, Christian Hergert
committed Details | Review

Description Michael Catanzaro 2017-12-08 17:56:29 UTC
Today I started seeing a hang when opening my Epiphany project in Builder nightly. Here's a representative backtrace taken during the hang. DzlRecursiveFileMonitor seems to be creating a new GLocalFileMonitor for every directory in WebKit.

Note that WebKit is part of the runtime, and is not even built as part of the Epiphany project, so at first I was not sure why this is happening. Then I remembered that I had tried bundling WebKit by adding it to the flatpak-builder manifest a few days ago. I had already changed my mind about that and gotten rid of it, but all the WebKit files were still there. So I deleted my .flatpak-builder subdirectory, which took a *long* time, and when that was done, the hangs disappeared and I was able to use Builder again.
Comment 1 Christian Hergert 2017-12-08 23:59:28 UTC
Hrmm, we should *not* be diving into directories that are ignored and creating file monitors there. (We have an explicit force-ignore on .flatpak-builder).
Comment 2 Christian Hergert 2017-12-09 06:22:27 UTC
Aha!

So in libdazzle, to avoid calling the ignored files check in a thread we do the tree scan in a thread. Then on the main thread, we do the ignored dir check. The .flatpak-builder directory is ignored, but then all the subdirs do not match.

If we sort the directories up front, then we should be able to simply skip-ahead when X+1..Z are descendants of X.
Comment 3 Christian Hergert 2017-12-09 06:34:32 UTC
Created attachment 365285 [details] [review]
file-monitor: improve ignored directory checks

If we take the cost of having O(h) directory FDs open (where `h'
is the height of the directory path from the root), then we can
reduce the number of ignored directory checks we must make. We
only need to walk past all the files with the ignored directory
as a path prefix.
Comment 4 Christian Hergert 2017-12-09 06:35:00 UTC
Fixed in libdazzle.

Attachment 365285 [details] pushed as 063fe8f - file-monitor: improve ignored directory checks