GNOME Bugzilla – Bug 301068
GtkFileChoose on systems with NFS / AFS will hang for 20 minutes+
Last modified: 2005-05-10 01:59:40 UTC
GtkFileChoose inspects the whole file tree up to root point. Having mounted external disks via Transarc's AFS under /afs produces an interrupt of more than 20 minutes for a single file open because every AFS cell around the world is inspected before the widget comes up. To avoid this GtkFileChoose must not inspect /afs. The same should be done for /net.
If you already identified this as GtkFileChoose, why did you file it as a bug against GIMP?
because I think either GIMP or GTK could be modified because of this.
Please specify the version of GTK+ that you are using so that we can properly reassign this bug report.
sorry! the version is 2.4.14
Re-assigned to gtk+ (and sorry for the CC: noise)
Just to refresh my memory, can you please confirm these statements: 1. Doing stat("/afs", &statbuf) is fine. 2. Doing opendir("/afs") and then readdir() is *not* fine.
both seems to work. What happens on 'open file' in gimp ist listed below: Every entry of a directory ist treated with stat64. The time consuming actions are the lines with 'lost contact'. I don't see a logical reason why one must inspect every entry of each parent directory (!!) with stat64. That should be done if I select this direcory, not before. The output below is produced with the 'truss' command which lists every system call 19103: stat64("/afs", 0xFFBFD4B0) = 0 19103: open("/afs", O_RDONLY|O_NDELAY|O_LARGEFILE) = 6 19103: fstat64(6, 0xFFBFD360) = 0 19103: fcntl(6, F_SETFD, 0x00000001) = 0 19103: getdents64(6, 0x00D52E48, 8192) = 5072 19103: getdents64(6, 0x00D52E48, 8192) = 0 19103: close(6) = 0 19103: time() = 1113998738 afs: Lost contact with volume location server 195.42.214.241 in cell extundo.com 19103: stat64("/afs/extundo.com", 0x00E1FAA0) Err#145 ETIMEDOUT afs: Lost contact with volume location server 128.114.129.14 in cell cats.ucsc.edu afs: Lost contact with volume location server 128.114.129.18 in cell cats.ucsc.edu
I am pretty sure 2.6 does not do this. At least for me, it does not stat every entry in parent directories. If you were to navigate to /afs you would still be in trouble with 2.6. The only fix for that would be to fake the stat-ing for any entry in /afs (i.e., simply pretend it is a 0755 directory).
Created attachment 45962 [details] [review] Patch for gtkfilechooserdefault.c and gtkfilesystemunix.c This patch fixes the stock Unix backend. A forthcoming patch will fix the VFS backend. I committed this patch to the gtk-2-6 and HEAD branches.
I tested with 2.6. The problem of 20 minutes+ from 2.4 shrinked to about 10 seconds. Not so bad but not good. So I agree Morton that 2.6 does not stat every entry in parent directories. But his idea to change to 0755 is impossible for AFS root path. Nevertheless: According to bug 302322 a file open lasts too long for full directories.
Could you please run 'strace -ttt -f -o logfile.txt gimp', then visit your /afs, and attach the gzipped strace log to this bug? Just to confirm: did you apply the patch I attached, or did you pick up the latest code in the gtk-2-6 branch from CVS?
Changing the product/component to libgnomeui/file-chooser since that's what remains to be fixed for now.
About comment #11, please massage that command line to be friendly to 'truss' :) I basically need timestamps for the system calls and per-thread information.
I just fixed a leftover problem in the Unix backend (fill_in_mime_type was stat()ing unconditionally), so you may want to update your GTK+ again. It's in the gtk-2-6 and HEAD branches.
Applying the patch of comment #9 improves the time for file open dramatically to ~ one second. Unfortunately I could install only strace 4.3 under Solaris. All newer releases refuse to compile because of unknown POSIX_FADV_* variables. strace-4.3 refused to follow the gimp child processes of your comment #11. So I'm unable to send you the log file at the moment. Replacing the gtkfilesystemunix.c from CVS (comment #14) I get the following compiler error: gtkfilesystemunix.c: In function `gtk_file_system_unix_iface_init': gtkfilesystemunix.c:324: error: structure has no member named `get_bookmark_label' gtkfilesystemunix.c:325: error: structure has no member named `set_bookmark_label'
I'm pretty sure that you took gtkfilesystemunix.c from HEAD and put it into your 2.6 tree. If that is the case, please grab the same file from the gtk-2-6 branch instead.
Created attachment 46264 [details] [review] Patch to fix GtkFileSystemGnomeVFS in libgnomeui This patch fixes the VFS backend for the file chooser so that it does not stat() entries under /afs or /net. With this, the whole bug is fixed.
I already committed the libgnomeui patch to the gnome-2-10 and HEAD branches, by the way.